Skip to content

Commit b416863

Browse files
committed
Changed the image in button control for icon template selector(development).
1 parent a86a132 commit b416863

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

wpf/Button/Getting-Started.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,11 @@ The [IconTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.C
314314
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
315315
mc:Ignorable="d"
316316
Title="MainWindow" Height="450" Width="800">
317+
317318
<Window.DataContext>
318319
<local:ViewModel/>
319320
</Window.DataContext>
321+
320322
<Window.Resources>
321323
<DataTemplate x:Key="checkedIcon">
322324
<Grid Width="12" Height="16">
@@ -346,9 +348,10 @@ The [IconTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.C
346348
</DataTemplate>
347349
<local:IconTemplateSelector x:Key="IconTemplateSelector" CheckedIcon="{StaticResource checkedIcon}" UnCheckedIcon="{StaticResource unCheckedIcon}"/>
348350
</Window.Resources>
351+
349352
<Grid>
350353
<StackPanel VerticalAlignment="Center">
351-
<CheckBox Name="Check" IsChecked="{Binding IsChecked,Mode=TwoWay}" HorizontalAlignment="Center" Content="ChangeIcon"/>
354+
<CheckBox Name="Check" IsChecked="{Binding IsChecked, Mode=TwoWay}" HorizontalAlignment="Center" Content="ChangeIcon"/>
352355
<syncfusion:ButtonAdv x:Name="button" HorizontalAlignment="Center" Margin="10" Label="IconTemplateSelector" IconTemplateSelector="{StaticResource IconTemplateSelector}" DataContext="{Binding IsChecked}"/>
353356
</StackPanel>
354357
</Grid>
@@ -358,7 +361,7 @@ The [IconTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.C
358361

359362
{% highlight c# %}
360363

361-
public class ViewModel : INotifyPropertyChanged
364+
public class ViewModel : INotifyPropertyChanged
362365
{
363366
private bool _isChecked;
364367
public bool IsChecked
@@ -373,9 +376,9 @@ The [IconTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.C
373376
}
374377
}
375378
}
376-
377-
379+
378380
public event PropertyChangedEventHandler PropertyChanged;
381+
379382
protected void OnPropertyChanged(string propertyName) =>
380383
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
381384
}
@@ -384,6 +387,7 @@ The [IconTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.C
384387
{
385388
public DataTemplate CheckedIcon { get; set; }
386389
public DataTemplate UnCheckedIcon { get; set; }
390+
387391
public override DataTemplate SelectTemplate(object item, DependencyObject container)
388392
{
389393
if (item is bool isChecked)
@@ -398,7 +402,7 @@ The [IconTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.C
398402

399403
{% endtabs %}
400404

401-
![IconTemplateSelector in WPF Button](Getting-Started_images/Getting-Started_IconTemplateSelector.gif)
405+
![IconTemplateSelector in WPF Button](Getting-Started_images/Getting-Started_IconTemplateSelector.gif)
402406

403407
N> The [ButtonAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html) loads the icon in the following priority order.
404408
* [IconTemplateSelector](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_IconTemplateSelector)
Loading
Binary file not shown.

0 commit comments

Comments
 (0)