Skip to content

Commit 2e1631c

Browse files
authored
Fix1203 (#1681)
* Fix naming of fields in demo app * Making sure height of selected item is respected.
1 parent d758942 commit 2e1631c

File tree

9 files changed

+17
-199
lines changed

9 files changed

+17
-199
lines changed

MainDemo.Wpf/Domain/MainWindowViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ private ObservableCollection<DemoItem> GenerateDemoItems(ISnackbarMessageQueue s
121121
DocumentationLink.StyleLink("RatingBar"),
122122
DocumentationLink.ApiLink<RatingBar>()
123123
}),
124-
new DemoItem("Fields", new TextFields(),
124+
new DemoItem("Fields", new Fields(),
125125
new []
126126
{
127-
DocumentationLink.DemoPageLink<TextFields>(),
127+
DocumentationLink.DemoPageLink<Fields>(),
128128
DocumentationLink.StyleLink("TextBox"),
129129
DocumentationLink.StyleLink("ComboBox"),
130130
})

MainDemo.Wpf/Domain/TextFieldsViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
namespace MaterialDesignColors.WpfExample.Domain
77
{
8-
public class TextFieldsViewModel : INotifyPropertyChanged
8+
public class FieldsViewModel : INotifyPropertyChanged
99
{
1010
private string _name;
1111
private string _name2;
1212
private int? _selectedValueOne;
1313
private string _selectedTextTwo;
1414

15-
public TextFieldsViewModel()
15+
public FieldsViewModel()
1616
{
1717
LongListToTestComboVirtualization = new List<int>(Enumerable.Range(0, 1000));
1818

MainDemo.Wpf/TextFields.xaml renamed to MainDemo.Wpf/Fields.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<UserControl x:Class="MaterialDesignColors.WpfExample.TextFields"
1+
<UserControl x:Class="MaterialDesignColors.WpfExample.Fields"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -8,8 +8,8 @@
88
xmlns:domain1="clr-namespace:MaterialDesignDemo.Domain"
99
xmlns:smtx="clr-namespace:ShowMeTheXAML;assembly=ShowMeTheXAML"
1010
mc:Ignorable="d"
11-
d:DesignHeight="300" d:DesignWidth="600" Loaded="UserControl_Loaded"
12-
d:DataContext="{d:DesignInstance domain:TextFieldsViewModel, d:IsDesignTimeCreatable=False}">
11+
d:DesignHeight="300" d:DesignWidth="600"
12+
d:DataContext="{d:DesignInstance domain:FieldsViewModelIsDesignTimeCreatable=False}">
1313
<UserControl.Resources>
1414
<ResourceDictionary>
1515
<ResourceDictionary.MergedDictionaries>

MainDemo.Wpf/TextFields.xaml.cs renamed to MainDemo.Wpf/Fields.xaml.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System.Windows;
2-
using System.Windows.Controls;
1+
using System.Windows.Controls;
32
using System.Windows.Navigation;
43
using MaterialDesignColors.WpfExample.Domain;
54
using MaterialDesignDemo.Domain;
@@ -9,16 +8,12 @@ namespace MaterialDesignColors.WpfExample
98
/// <summary>
109
/// Interaction logic for TextFields.xaml
1110
/// </summary>
12-
public partial class TextFields : UserControl
11+
public partial class Fields : UserControl
1312
{
14-
public TextFields()
13+
public Fields()
1514
{
1615
InitializeComponent();
17-
DataContext = new TextFieldsViewModel();
18-
}
19-
20-
private void UserControl_Loaded(object sender, RoutedEventArgs e)
21-
{
16+
DataContext = new FieldsViewModel();
2217
}
2318

2419
private void Hyperlink_OnRequestNavigate(object sender, RequestNavigateEventArgs e)

MainDemo.Wpf/MaterialDesignDemo.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,6 @@
138138
<SubType>Designer</SubType>
139139
<Generator>MSBuild:Compile</Generator>
140140
</Page>
141-
<Page Include="ProvingGround.xaml">
142-
<SubType>Designer</SubType>
143-
<Generator>MSBuild:Compile</Generator>
144-
</Page>
145141
<Page Include="RatingBar.xaml">
146142
<Generator>MSBuild:Compile</Generator>
147143
<SubType>Designer</SubType>
@@ -158,7 +154,7 @@
158154
<SubType>Designer</SubType>
159155
<Generator>MSBuild:Compile</Generator>
160156
</Page>
161-
<Page Include="TextFields.xaml">
157+
<Page Include="Fields.xaml">
162158
<SubType>Designer</SubType>
163159
<Generator>MSBuild:Compile</Generator>
164160
</Page>

MainDemo.Wpf/ProvingGround.xaml

Lines changed: 0 additions & 53 deletions
This file was deleted.

MainDemo.Wpf/ProvingGround.xaml.cs

Lines changed: 0 additions & 92 deletions
This file was deleted.

MainDemo.Wpf/ProvingGroundStuff/MeasuringTextBox.cs

Lines changed: 0 additions & 33 deletions
This file was deleted.

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ComboBox.xaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@
284284
<VisualState Name="Unfocused" />
285285
</VisualStateGroup>
286286
</VisualStateManager.VisualStateGroups>
287+
288+
<Grid.RowDefinitions>
289+
<RowDefinition Height="Auto" />
290+
</Grid.RowDefinitions>
291+
287292
<Border x:Name="BackBorder"
288293
Background="{TemplateBinding Background}"
289294
BorderBrush="{TemplateBinding BorderBrush}"

0 commit comments

Comments
 (0)