Skip to content

Commit ad445e0

Browse files
author
prabakaran.sangameswaran
committed
New button sample updated.
1 parent 9382784 commit ad445e0

File tree

4 files changed

+37
-11
lines changed

4 files changed

+37
-11
lines changed

Samples/NewButton/MainWindow.xaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
IsNewButtonClosedonNoChild="{Binding IsNewButtonClosedonNoChild}"
2727
IsNewButtonEnabled="{Binding IsNewButtonEnabled}"
2828
NewButtonAlignment="{Binding NewButtonAlignment}"
29+
SelectOnCreatingNewItem="{Binding SelectOnCreatingNewItem}"
2930
Margin="20"
3031
Name="tabControlExt">
3132

@@ -87,6 +88,7 @@
8788
<RowDefinition Height="Auto"></RowDefinition>
8889
<RowDefinition Height="Auto"></RowDefinition>
8990
<RowDefinition Height="Auto"></RowDefinition>
91+
<RowDefinition Height="Auto"></RowDefinition>
9092
</Grid.RowDefinitions>
9193
<Grid.ColumnDefinitions>
9294
<ColumnDefinition Width="*"></ColumnDefinition>
@@ -132,6 +134,15 @@
132134
Grid.Row="3"
133135
Grid.Column="1"
134136
Margin="3"/>
137+
138+
<TextBlock Margin="3"
139+
Text ="SelectOnCreatingNewItem"
140+
Grid.Row="4"
141+
Grid.Column="0"/>
142+
<CheckBox IsChecked="{Binding SelectOnCreatingNewItem, Mode=TwoWay}"
143+
Grid.Row="4"
144+
Grid.Column="1"
145+
Margin="3"/>
135146
</Grid>
136147
</GroupBox>
137148
</Grid>

Samples/NewButton/NewButton.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838
<Reference Include="Microsoft.Expression.Interactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
3939
<HintPath>packages\System.Windows.Interactivity.WPF.2.0.20525\lib\net40\Microsoft.Expression.Interactions.dll</HintPath>
4040
</Reference>
41-
<Reference Include="Syncfusion.Licensing, Version=18.1460.0.46, Culture=neutral, PublicKeyToken=632609b4d040f6b4, processorArchitecture=MSIL">
42-
<HintPath>packages\Syncfusion.Licensing.18.1.0.46\lib\net46\Syncfusion.Licensing.dll</HintPath>
41+
<Reference Include="Syncfusion.Licensing, Version=18.3460.0.50, Culture=neutral, PublicKeyToken=632609b4d040f6b4, processorArchitecture=MSIL">
42+
<HintPath>packages\Syncfusion.Licensing.18.3.0.50\lib\net46\Syncfusion.Licensing.dll</HintPath>
4343
</Reference>
44-
<Reference Include="Syncfusion.Shared.WPF, Version=18.1460.0.46, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
45-
<HintPath>packages\Syncfusion.Shared.WPF.18.1.0.46\lib\net46\Syncfusion.Shared.WPF.dll</HintPath>
44+
<Reference Include="Syncfusion.Shared.WPF, Version=18.3460.0.50, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
45+
<HintPath>packages\Syncfusion.Shared.WPF.18.3.0.50\lib\net46\Syncfusion.Shared.WPF.dll</HintPath>
4646
</Reference>
47-
<Reference Include="Syncfusion.Tools.WPF, Version=18.1460.0.46, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
48-
<HintPath>packages\Syncfusion.Tools.WPF.18.1.0.46\lib\net46\Syncfusion.Tools.WPF.dll</HintPath>
47+
<Reference Include="Syncfusion.Tools.WPF, Version=18.3460.0.50, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
48+
<HintPath>packages\Syncfusion.Tools.WPF.18.3.0.50\lib\net46\Syncfusion.Tools.WPF.dll</HintPath>
4949
</Reference>
5050
<Reference Include="System" />
5151
<Reference Include="System.Data" />

Samples/NewButton/ViewModel/ViewModel.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,20 @@ public class ViewModel : NotificationObject
1414
private Brush newButtonBackground = Brushes.Red;
1515
private bool isNewButtonClosedonNoChild=true;
1616
private bool isNewButtonEnabled = true;
17+
private bool selectOnCreatingNewItem = true;
1718
private ObservableCollection<TabItem_ViewModel> tabItems;
18-
private DelegateCommand<object> newButtonClickCommand;
19+
private ICommand newButtonClickCommand;
1920

2021
public ICommand NewButtonClickCommand
2122
{
2223
get
2324
{
2425
return newButtonClickCommand;
2526
}
27+
set
28+
{
29+
newButtonClickCommand = value;
30+
}
2631
}
2732
public Brush NewButtonBackground
2833
{
@@ -51,6 +56,16 @@ public bool IsNewButtonEnabled
5156
isNewButtonEnabled = value;
5257
this.RaisePropertyChanged(nameof(IsNewButtonEnabled));
5358
}
59+
}
60+
61+
public bool SelectOnCreatingNewItem
62+
{
63+
get { return selectOnCreatingNewItem; }
64+
set
65+
{
66+
selectOnCreatingNewItem = value;
67+
this.RaisePropertyChanged(nameof(SelectOnCreatingNewItem));
68+
}
5469
}
5570
public bool IsNewButtonClosedonNoChild
5671
{
@@ -104,7 +119,7 @@ public ViewModel()
104119
{
105120
tabItems = new ObservableCollection<TabItem_ViewModel>();
106121
PopulateCollection();
107-
newButtonClickCommand = new DelegateCommand<object>(NewButtonClicked);
122+
NewButtonClickCommand = new DelegateCommand<object>(NewButtonClicked);
108123
}
109124
}
110125
}

Samples/NewButton/packages.config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Syncfusion.Licensing" version="18.1.0.46" targetFramework="net46" />
4-
<package id="Syncfusion.Shared.WPF" version="18.1.0.46" targetFramework="net46" />
5-
<package id="Syncfusion.Tools.WPF" version="18.1.0.46" targetFramework="net46" />
3+
<package id="Syncfusion.Licensing" version="18.3.0.50" targetFramework="net46" />
4+
<package id="Syncfusion.Shared.WPF" version="18.3.0.50" targetFramework="net46" />
5+
<package id="Syncfusion.Tools.WPF" version="18.3.0.50" targetFramework="net46" />
66
<package id="System.Windows.Interactivity.WPF" version="2.0.20525" targetFramework="net46" />
77
</packages>

0 commit comments

Comments
 (0)