forked from microsoft/VSExtensibility
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyToolWindowControl.xaml
52 lines (52 loc) · 2.74 KB
/
MyToolWindowControl.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<DataTemplate xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vs="http://schemas.microsoft.com/visualstudio/extensibility/2022/xaml"
xmlns:styles="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.15.0"
xmlns:colors="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0">
<Border Background="{DynamicResource {x:Static colors:EnvironmentColors.ToolWindowBackgroundBrushKey}}"
TextElement.Foreground="{DynamicResource {x:Static colors:EnvironmentColors.ToolWindowTextBrushKey}}"
Padding="5">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock Margin="0,0,5,0"
Text="Custom Message:"
VerticalAlignment="Center" />
<TextBox x:Name="TitleTextBox"
MinHeight="26"
MinWidth="200"
HorizontalContentAlignment="Left"
VerticalContentAlignment="Center"
Text="{Binding Message, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource {x:Static styles:VsResourceKeys.TextBoxStyleKey}}">
<TextBox.ContextMenu>
<ContextMenu Style="{DynamicResource {x:Static styles:VsResourceKeys.ContextMenuStyleKey}}">
<MenuItem Header="Clear" Command="{Binding ClearCommand}">
<MenuItem.Icon>
<vs:Image Source="KnownMonikers.ClearWindowContent" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Default message" Command="{Binding DefaultTextCommand}">
<MenuItem.Icon>
<vs:Image Source="DefaultText" />
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</TextBox.ContextMenu>
</TextBox>
<Button x:Name="ShowMessageButton"
Content="Show Dialog"
IsEnabled="False"
Margin="5,0,0,0"
MinHeight="25"
MinWidth="60"
Style="{StaticResource {x:Static styles:VsResourceKeys.ButtonStyleKey}}"
Command="{Binding ShowMessageCommand}" />
</StackPanel>
</Border>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding HasError}" Value="False">
<Setter TargetName="ShowMessageButton" Property="IsEnabled" Value="True" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>