Skip to content

Commit f825784

Browse files
committed
Fix issue : (#166 )add WDUserControl
1 parent 8822f63 commit f825784

File tree

5 files changed

+52
-2
lines changed

5 files changed

+52
-2
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System.Windows;
2+
using System.Windows.Controls;
3+
4+
namespace WPFDevelopers.Controls
5+
{
6+
public class WDUserControl : ContentControl
7+
{
8+
static WDUserControl()
9+
{
10+
DefaultStyleKeyProperty.OverrideMetadata(typeof(WDUserControl),
11+
new FrameworkPropertyMetadata(typeof(WDUserControl)));
12+
}
13+
}
14+
}

src/WPFDevelopers.Shared/Themes/Theme40.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,6 @@ TimePicker.xaml
6969
Drawer.xaml
7070
DateRangePicker.xaml
7171
Tag.xaml
72-
NavScrollPanel.xamlGestureUnlock.xaml
72+
NavScrollPanel.xaml
73+
GestureUnlock.xaml
74+
WDUserControl.xaml

src/WPFDevelopers.Shared/Themes/Theme45x.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,6 @@ TimePicker.xaml
7070
Drawer.xaml
7171
DateRangePicker.xaml
7272
Tag.xaml
73-
NavScrollPanel.xamlGestureUnlock.xaml
73+
NavScrollPanel.xaml
74+
GestureUnlock.xaml
75+
WDUserControl.xaml
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<ResourceDictionary
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:controls="clr-namespace:WPFDevelopers.Controls"
5+
xmlns:helpers="clr-namespace:WPFDevelopers.Helpers"
6+
xmlns:resx="clr-namespace:WPFDevelopers">
7+
<ResourceDictionary.MergedDictionaries>
8+
<ResourceDictionary Source="Basic/ControlBasic.xaml" />
9+
</ResourceDictionary.MergedDictionaries>
10+
<Style
11+
x:Key="WD.WDUserControl"
12+
BasedOn="{StaticResource WD.ControlBasicStyle}"
13+
TargetType="{x:Type controls:WDUserControl}">
14+
<Setter Property="Background" Value="{DynamicResource WD.BackgroundBrush}" />
15+
<Setter Property="Template">
16+
<Setter.Value>
17+
<ControlTemplate TargetType="{x:Type controls:WDUserControl}">
18+
<Border Background="{TemplateBinding Background}">
19+
<ContentPresenter />
20+
</Border>
21+
</ControlTemplate>
22+
</Setter.Value>
23+
</Setter>
24+
</Style>
25+
<Style BasedOn="{StaticResource WD.WDUserControl}" TargetType="{x:Type controls:WDUserControl}" />
26+
27+
</ResourceDictionary>

src/WPFDevelopers.Shared/WPFDevelopers.Shared.projitems

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<Compile Include="$(MSBuildThisFileDirectory)Controls\BaseControls\ScaleBase.cs" />
1313
<Compile Include="$(MSBuildThisFileDirectory)Controls\BaseControls\SliderRepeatButton.cs" />
1414
<Compile Include="$(MSBuildThisFileDirectory)Controls\BaseControls\WDBorder.cs" />
15+
<Compile Include="$(MSBuildThisFileDirectory)Controls\BaseControls\WDUserControl.cs" />
1516
<Compile Include="$(MSBuildThisFileDirectory)Controls\Charts\ChartBase.cs" />
1617
<Compile Include="$(MSBuildThisFileDirectory)Controls\Charts\ChartLine.cs" />
1718
<Compile Include="$(MSBuildThisFileDirectory)Controls\Charts\ChartPie.cs" />
@@ -559,6 +560,10 @@
559560
<Generator>MSBuild:Compile</Generator>
560561
<SubType>Designer</SubType>
561562
</Page>
563+
<Page Include="$(MSBuildThisFileDirectory)Themes\WDUserControl.xaml">
564+
<SubType>Designer</SubType>
565+
<Generator>MSBuild:Compile</Generator>
566+
</Page>
562567
</ItemGroup>
563568
<ItemGroup>
564569
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Languages\Language.en-US.resx" />

0 commit comments

Comments
 (0)