Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit549d841

Browse files
authored
Merge pull requestdotnet#4698 from majocha/xaml-loading
Fix QuickInfo problems related to resource loading (dotnet#4695)
2 parentsedb6b11 +e11d4c1 commit549d841

File tree

4 files changed

+81
-55
lines changed

4 files changed

+81
-55
lines changed

‎vsintegration/src/FSharp.Editor/QuickInfo/WpfNagivableTextRunViewElementFactory.fs‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,6 @@ open Microsoft.VisualStudio.Text.Adornments
1111
openMicrosoft.VisualStudio.Text.Editor
1212
openMicrosoft.VisualStudio.Utilities
1313

14-
moduleprivateResources=
15-
letstyles=
16-
#if DEBUG
17-
// load ResourceDictionary in a not 100% safe way for better debugging experience
18-
if(isNull Application.ResourceAssembly)then
19-
Application.ResourceAssembly<- typeof<Microsoft.VisualStudio.FSharp.UIResources.QuickInfoOptionControl>.Assembly
20-
ResourceDictionary(Source= Uri("HyperlinkStyles.xaml", UriKind.Relative))
21-
else
22-
#endif
23-
ResourceDictionary(Source= Uri(@"/FSharp.UIResources;component/HyperlinkStyles.xaml", UriKind.Relative))
24-
25-
2614
[<Export(typeof<IViewElementFactory>)>]
2715
[<Name("NavigableTextRun to UIElement")>]
2816
[<TypeConversion(typeof<NavigableTextRun>, typeof<UIElement>)>]
@@ -32,6 +20,7 @@ type WpfNavigableTextRunViewElementFactory
3220
(
3321
viewElementFactoryService:IViewElementFactoryService
3422
)=
23+
letstyles= Microsoft.VisualStudio.FSharp.UIResources.NavStyles()
3524
interface IViewElementFactorywith
3625
override__.CreateViewElement<'TViewwhen'TView:notstruct>(textView:ITextView,model:obj):'TView=
3726
ifnot(model:? NavigableTextRun)|| typeof<'TView><> typeof<UIElement>then
@@ -55,7 +44,7 @@ type WpfNavigableTextRunViewElementFactory
5544
| QuickInfoUnderlineStyle.Dot->"dot_underline"
5645
else
5746
"no_underline"
58-
Resources.styles.[key]:?> Style
47+
styles.Resources.[key]:?> Style
5948

6049
// we need to enclose the generated Inline, which is actually a Run element,
6150
// because fancy styling does not seem to work properly with Runs

‎vsintegration/src/FSharp.UIResources/HyperlinkStyles.xaml‎

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<UserControlx:Class="Microsoft.VisualStudio.FSharp.UIResources.NavStyles"
2+
x:ClassModifier="internal"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:local="clr-namespace:Microsoft.VisualStudio.FSharp.UIResources"
8+
mc:Ignorable="d"
9+
d:DesignHeight="450"d:DesignWidth="800">
10+
<UserControl.Resources>
11+
<SolidColorBrushx:Key="inherited_brush"Color="{Binding Path=Foreground.Color, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Underline}}" />
12+
<SolidColorBrushx:Key="inherited_semi_brush"Opacity="0.28"Color="{Binding Path=Foreground.Color, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Underline}}" />
13+
<DashStylex:Key="dash_dashstyle"Dashes="5 5"/>
14+
<DashStylex:Key="dot_dashstyle"Dashes="1 5"/>
15+
<Penx:Key="dot_pen"DashStyle="{StaticResource dot_dashstyle}"Brush="{StaticResource inherited_brush}"/>
16+
<Penx:Key="solid_pen"Brush="{StaticResource inherited_semi_brush}"/>
17+
<Penx:Key="mouseover_pen"Brush="{StaticResource inherited_brush}"/>
18+
<Penx:Key="dash_pen"DashStyle="{StaticResource dash_dashstyle}"Brush="{StaticResource inherited_semi_brush}"/>
19+
<TextDecorationCollectionx:Key="solid_deco">
20+
<TextDecorationPenOffset="1"Pen="{StaticResource solid_pen}"/>
21+
</TextDecorationCollection>
22+
<TextDecorationCollectionx:Key="dash_deco">
23+
<TextDecorationPenOffset="1"Pen="{StaticResource dash_pen}"/>
24+
</TextDecorationCollection>
25+
<TextDecorationCollectionx:Key="dot_deco">
26+
<TextDecorationPenOffset="1"Pen="{StaticResource dot_pen}"/>
27+
</TextDecorationCollection>
28+
<TextDecorationCollectionx:Key="full_deco">
29+
<TextDecorationPenOffset="1"Pen="{StaticResource mouseover_pen}" />
30+
</TextDecorationCollection>
31+
<Stylex:Key="base_sourcelink"TargetType="Underline" >
32+
<Style.Triggers>
33+
<TriggerProperty="IsMouseOver"Value="true">
34+
<SetterProperty="TextDecorations"Value="{StaticResource full_deco}"/>
35+
</Trigger>
36+
</Style.Triggers>
37+
</Style>
38+
<Stylex:Key="solid_underline"TargetType="Underline"BasedOn="{StaticResource base_sourcelink}">
39+
<SetterProperty="TextDecorations"Value="{StaticResource solid_deco}"/>
40+
</Style>
41+
<Stylex:Key="dash_underline"TargetType="Underline"BasedOn="{StaticResource base_sourcelink}">
42+
<SetterProperty="TextDecorations"Value="{StaticResource dash_deco}"/>
43+
</Style>
44+
<Stylex:Key="dot_underline"TargetType="Underline"BasedOn="{StaticResource base_sourcelink}">
45+
<SetterProperty="TextDecorations"Value="{StaticResource dot_deco}"/>
46+
</Style>
47+
<Stylex:Key="no_underline"TargetType="Underline"BasedOn="{StaticResource base_sourcelink}">
48+
<SetterProperty="TextDecorations"Value="{x:Null}"/>
49+
</Style>
50+
</UserControl.Resources>
51+
</UserControl>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
usingSystem;
2+
usingSystem.Collections.Generic;
3+
usingSystem.Linq;
4+
usingSystem.Text;
5+
usingSystem.Threading.Tasks;
6+
usingSystem.Windows;
7+
usingSystem.Windows.Controls;
8+
usingSystem.Windows.Data;
9+
usingSystem.Windows.Documents;
10+
usingSystem.Windows.Input;
11+
usingSystem.Windows.Media;
12+
usingSystem.Windows.Media.Imaging;
13+
usingSystem.Windows.Navigation;
14+
usingSystem.Windows.Shapes;
15+
16+
namespaceMicrosoft.VisualStudio.FSharp.UIResources
17+
{
18+
/// <summary>
19+
/// Interaction logic for NavStyles.xaml
20+
/// </summary>
21+
internalpartialclassNavStyles:UserControl
22+
{
23+
publicNavStyles()
24+
{
25+
InitializeComponent();
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp