/
App.xaml
88 lines (81 loc) · 5.83 KB
/
App.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<Application x:Class="SmartTagCustomization.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SmartTagCustomization"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:forms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:dxrud="http://schemas.devexpress.com/winfx/2008/xaml/reports/userdesigner"
xmlns:dxrudt="http://schemas.devexpress.com/winfx/2008/xaml/reports/userdesigner/themekeys"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:dxrude="clr-namespace:DevExpress.Xpf.Reports.UserDesigner.Editors;assembly=DevExpress.Xpf.ReportDesigner.v23.1"
xmlns:xrdiagram="clr-namespace:DevExpress.Xpf.Reports.UserDesigner.XRDiagram;assembly=DevExpress.Xpf.ReportDesigner.v23.1"
xmlns:xtrareports="clr-namespace:DevExpress.XtraReports;assembly=DevExpress.XtraReports.v23.1"
StartupUri="MainWindow.xaml">
<Application.Resources>
<DataTemplate x:Key="dataBindingTemplate">
<dxlc:LayoutItem x:Name="DataBindings" Label="{dxrud:ReportDesignerStringId StringId=Properties_DataBinding}">
<dxrude:PopupTreeListEdit EditValue="{Binding ProgressBinding, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Style="{DynamicResource {dxrudt:SmartTagEditorsThemeKey ResourceKey=DataBindingEditorStyle}}" />
</dxlc:LayoutItem>
</DataTemplate>
<DataTemplate x:Key="expressionBindingTemplate">
<dxlc:LayoutItem Label="{dxrud:ReportDesignerStringId StringId=Properties_Expression}">
<dxe:PopupBaseEdit EditValue="{Binding ProgressBinding, UpdateSourceTrigger=PropertyChanged}"
ValidateOnEnterKeyPressed="True"
ValidateOnTextInput="False"
Style="{DynamicResource {dxrudt:SmartTagEditorsThemeKey ResourceKey=PopupWithExpressionEditorStyle}}" />
</dxlc:LayoutItem>
</DataTemplate>
<local:BindingModeToPropertyTemplateConverter x:Key="templateConverter"
BindingTemplate="{StaticResource dataBindingTemplate}"
ExpressionTemplate="{StaticResource expressionBindingTemplate}" />
<Style TargetType="{x:Type local:XRProgressBarDiagramItem}" BasedOn="{StaticResource {x:Type xrdiagram:XRControlDiagramItem}}">
<Setter Property="SmartTagTemplate">
<Setter.Value>
<DataTemplate>
<dxlc:LayoutControl Width="345" MaxHeight="600">
<dxlc:LayoutGroup>
<dxlc:LayoutGroup Orientation="Vertical">
<dxlc:LayoutItem Label="Max Value">
<dxe:SpinEdit EditValue="{Binding MaxValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
EditValueType="{x:Type sys:Single}" />
</dxlc:LayoutItem>
<dxlc:GroupSeparator />
<dxlc:LayoutItem Label="Progress">
<dxe:TrackBarEdit EditValue="{Binding Progress, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Minimum="0"
Maximum="{Binding MaxValue, UpdateSourceTrigger=PropertyChanged}"
EditValueType="{x:Type sys:Single}"
/>
</dxlc:LayoutItem>
<ContentControl Content="{Binding}" ContentTemplate="{Binding ReportModel.DataBindingMode, Converter={StaticResource templateConverter}}" />
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
</dxlc:LayoutControl>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<DataTemplate x:Key="{dxrudt:SmartTagThemeKey ResourceKey=XRCheckBoxSmartTag}">
<dxlc:LayoutControl Width="345" MaxHeight="600">
<dxlc:LayoutGroup>
<dxlc:LayoutGroup Orientation="Vertical">
<dxlc:LayoutItem>
<TextBlock Text="This is a custom smartTag template" />
</dxlc:LayoutItem>
<dxlc:LayoutItem Label="Check state">
<dxe:ComboBoxEdit EditValue="{Binding CheckState, UpdateSourceTrigger=PropertyChanged}"
IsTextEditable="False"
ItemsSource="{dxe:EnumItemsSource EnumType=forms:CheckState}"
/>
</dxlc:LayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
</dxlc:LayoutControl>
</DataTemplate>
</Application.Resources>
</Application>