-
Notifications
You must be signed in to change notification settings - Fork 0
/
DiagramResources.xaml
54 lines (51 loc) · 2.94 KB
/
DiagramResources.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
53
54
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxdiag="http://schemas.devexpress.com/winfx/2008/xaml/diagram"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:local="clr-namespace:DXDiagram.ContentItem">
<Style x:Key="formattedTextContentItem" TargetType="dxdiag:DiagramContentItem">
<Setter Property="Background" Value="#FF35779C"/>
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Margin="10">
DiagramContentItem allows you to use custom content in diagram items. For example, you can use it to display
<Run FontSize="14" Foreground="#FFF3F3A8" FontWeight="Bold">formatted</Run>
text.
</TextBlock>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="devExpressLogoContentItem" TargetType="dxdiag:DiagramContentItem">
<Setter Property="Background" Value="#FFEC7D32"/>
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel HorizontalAlignment="Center" Margin="10" VerticalAlignment="Center">
<TextBlock Text="Item with several images" VerticalAlignment="Center" FontSize="20"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Image Source="Images\DevExpressLogo.png" MaxHeight="32" Margin="5,0,0,0"/>
<Image Source="Images\Globe.png" MaxHeight="32"/>
<Image Source="Images\Apply.png" MaxHeight="32"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="buttonContentItem" TargetType="dxdiag:DiagramContentItem">
<Setter Property="Background" Value="Gray"/>
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10" DataContext="{dxmvvm:ViewModelSource Type={x:Type local:ButtonItemModel}}">
<TextBlock Text="Item with a command" VerticalAlignment="Center" FontSize="20"/>
<Button Content="Show additional info" Command="{Binding ShowMessageCommand}" MaxHeight="40" Margin="5,0,0,0" Cursor="Hand"/>
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>