Skip to content

Commit d6ad080

Browse files
929457 - Updated missed changes in Scheduler Xaml controls
1 parent 2e0c2ea commit d6ad080

File tree

4 files changed

+114
-123
lines changed

4 files changed

+114
-123
lines changed

wpf/Image-Editor/Text.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ Text can be aligned to the left, center, or right by clicking the corresponding
6363

6464
You can add text to an image using the AddText method programmatically. This method requires the following parameters:
6565

66-
* Text – Specifies the content you need to add on the image.
67-
* TextSettings - Customizes the text.
66+
* Text - Defines the content to be displayed on the image.
67+
* TextSettings - Allows customization of the text's appearance, including options for background, font family, font size, and font color. You can adjust the alignment (center, left, right) and improve the text with effects such as bold, italic, and underline.
6868

6969
{% tabs %}
7070
{% highlight XAML %}
@@ -117,7 +117,7 @@ this.editor.Loaded += this.OnImageEditorLoaded;
117117
private void OnImageEditorLoaded(object sender, RoutedEventArgs e)
118118
{
119119
TextSettings textSettings = new TextSettings();
120-
textSettings.Background = new SolidColorBrush(Colors.Yellow);
120+
textSettings.Background = new SolidColorBrush(Colors.PeachPuff);
121121
textSettings.FontFamily = new FontFamily("Century Schoolbook");
122122
textSettings.FontSize = 30;
123123
textSettings.Color = new SolidColorBrush(Colors.Red);
@@ -126,10 +126,10 @@ private void OnImageEditorLoaded(object sender, RoutedEventArgs e)
126126
this.editor.AddText("Good morning", textSettings);
127127

128128
textSettings = new TextSettings();
129-
textSettings.Background = new SolidColorBrush(Colors.Ivory);
129+
textSettings.Background = new SolidColorBrush(Colors.LightYellow);
130130
textSettings.FontFamily = new FontFamily("Bell MT");
131131
textSettings.FontSize = 22;
132-
textSettings.Color = new SolidColorBrush(Colors.DarkGreen);
132+
textSettings.Color = new SolidColorBrush(Colors.Teal);
133133
textSettings.TextEffects = TextEffects.Italic;
134134
textSettings.Bounds = new Rect(50, 23, 30, 15);
135135
textSettings.TextAlignment = TextAlignment.Center;
@@ -139,7 +139,7 @@ private void OnImageEditorLoaded(object sender, RoutedEventArgs e)
139139
{% endhighlight %}
140140
{% endtabs %}
141141

142-
![Text](Images/Text.jpg)
142+
![Text-settings-in-WPF-Image-editor](Images/text-settings-in-wpf-image-editor.jpg)
143143

144144
## See also
145145

wpf/Maps/Markers.md

Lines changed: 103 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ N> You must create a model that contains properties such as Latitude and Longitu
8383

8484
## Add a custom marker
8585

86-
The marker appearance customization can be achieved by using the [`MarkerTemplate`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.ShapeFileLayer.html#Syncfusion_UI_Xaml_Maps_ShapeFileLayer_MarkerTemplate) and `MarkerTemplateSelector` properties of [`ImageryLayer`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.ImageryLayer.html) and [`ShapeFileLayer`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.ShapeFileLayer.html) in the [`SfMap`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.SfMap.html).
86+
The marker appearance customization can be achieved by using the [`MarkerTemplate`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.ShapeFileLayer.html#Syncfusion_UI_Xaml_Maps_ShapeFileLayer_MarkerTemplate) and [`MarkerTemplateSelector`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.MapLayer.html#Syncfusion_UI_Xaml_Maps_MapLayer_MarkerTemplateSelector) properties of [`ImageryLayer`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.ImageryLayer.html) and [`ShapeFileLayer`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.ShapeFileLayer.html) in the [`SfMap`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.SfMap.html).
8787

8888
### Customize marker appearance using DataTemplate
8989

@@ -92,122 +92,117 @@ You can customize the marker appearance by using the [`MarkerTemplate`](https://
9292
{% tabs %}
9393
{% highlight xaml hl_lines="21" %}
9494

95-
<Grid>
96-
<Grid.Resources>
97-
<DataTemplate x:Key="markerTemplate">
98-
<Grid>
99-
<Canvas>
100-
<Ellipse Width="15" Height="15" Fill="Red"/>
101-
<TextBlock HorizontalAlignment="Center" Margin="0,20,0,0" FontSize="15" FontFamily="Segoe UI" Text="{Binding Label}"/>
102-
</Canvas>
103-
</Grid>
104-
</DataTemplate>
105-
</Grid.Resources>
106-
107-
<Grid.DataContext>
108-
<local:MapsViewModel />
109-
</Grid.DataContext>
110-
111-
<syncfusion:SfMap x:Name="maps">
112-
<syncfusion:SfMap.Layers>
113-
<syncfusion:ShapeFileLayer Uri="Maps.ShapeFiles.world1.shp"
114-
Markers="{Binding Markers}"
115-
MarkerTemplate="{StaticResource markerTemplate}">
116-
</syncfusion:ShapeFileLayer>
117-
</syncfusion:SfMap.Layers>
118-
</syncfusion:SfMap>
119-
</Grid>
95+
<Grid>
96+
<Grid.Resources>
97+
<DataTemplate x:Key="markerTemplate">
98+
<Grid>
99+
<Canvas>
100+
<Ellipse Width="15" Height="15" Fill="Red"/>
101+
<TextBlock HorizontalAlignment="Center" Margin="0,20,0,0" FontSize="15" FontFamily="Segoe UI" Text="{Binding Label}"/>
102+
</Canvas>
103+
</Grid>
104+
</DataTemplate>
105+
</Grid.Resources>
106+
107+
<Grid.DataContext>
108+
<local:MapsViewModel />
109+
</Grid.DataContext>
110+
111+
<syncfusion:SfMap x:Name="maps">
112+
<syncfusion:SfMap.Layers>
113+
<syncfusion:ShapeFileLayer Uri="Maps.ShapeFiles.world1.shp"
114+
Markers="{Binding Markers}"
115+
MarkerTemplate="{StaticResource markerTemplate}">
116+
</syncfusion:ShapeFileLayer>
117+
</syncfusion:SfMap.Layers>
118+
</syncfusion:SfMap>
119+
</Grid>
120120
121121
{% endhighlight %}
122122
{% highlight c# hl_lines="3" %}
123-
124-
ShapeFileLayer shape = new ShapeFileLayer();
125-
shape.Uri = "Maps.ShapeFiles.world1.shp";
126-
shape.MarkerTemplate= this.Resources["markerTemplate"] as DataTemplate;
127-
shape.Markers = view.Models;
128-
this.maps.Layers.Add(shape);
129-
123+
ShapeFileLayer shape = new ShapeFileLayer();
124+
shape.Uri = "Maps.ShapeFiles.world1.shp";
125+
shape.MarkerTemplate= this.Resources["markerTemplate"] as DataTemplate;
126+
shape.Markers = view.Models;
127+
this.maps.Layers.Add(shape);
130128
{% endhighlight %}
131129
{% highlight c# tabtitle="MarkerDetails.cs" %}
132-
133-
public class MarkerDetails
134-
{
135-
public string Label { get; set; }
136-
public string Longitude { get; set; }
137-
public string Latitude { get; set; }
138-
}
139-
130+
public class MarkerDetails
131+
{
132+
public string Label { get; set; }
133+
public string Longitude { get; set; }
134+
public string Latitude { get; set; }
135+
}
140136
{% endhighlight %}
141137
{% highlight c# tabtitle="MapsViewModel.cs" %}
138+
public class MapsViewModel
139+
{
140+
public ObservableCollection<MarkerDetails> Markers { get; set; }
142141

143-
public class MapsViewModel
142+
public MapsViewModel()
144143
{
145-
public ObservableCollection<MarkerDetails> Markers { get; set; }
146-
public MapsViewModel()
147-
{
148-
this.Markers = new ObservableCollection<MarkerDetails>();
149-
this.Markers.Add(new MarkerDetails() { Label = "India", Latitude = "21.0000N", Longitude = "78.0000E" });
150-
this.Markers.Add(new MarkerDetails() { Label = "China", Latitude = "35.0000N", Longitude = "103.0000E" });
151-
this.Markers.Add(new MarkerDetails() { Label = "Brazil", Latitude = "15.7833S", Longitude = "47.8667W" });
152-
}
144+
this.Markers = new ObservableCollection<MarkerDetails>();
145+
this.Markers.Add(new MarkerDetails() { Label = "India", Latitude = "21.0000N", Longitude = "78.0000E" });
146+
this.Markers.Add(new MarkerDetails() { Label = "China", Latitude = "35.0000N", Longitude = "103.0000E" });
147+
this.Markers.Add(new MarkerDetails() { Label = "Brazil", Latitude = "15.7833S", Longitude = "47.8667W" });
153148
}
149+
}
154150

155151
{% endhighlight %}
156152
{% endtabs %}
157153

158-
![Marker-template-support-in-WPF-Maps](Marker_images/marker-template-support-in-wpf-maps.png){:width="540" height="280"}
154+
![Marker-template-support-in-WPF-Maps](Marker_images/marker-template-support-in-wpf-maps.png)
159155

160156
### Customize marker appearance using DataTemplateSelector
161157

162-
You can customize the marker appearance by using the `MarkerTemplateSelector` property of [`ImageryLayer`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.ImageryLayer.html) and [`ShapeFileLayer`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.ShapeFileLayer.html) in the [`SfMap`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.SfMap.html). The `DataTemplateSelector` can choose a `DataTemplate` at runtime based on the value of a data-bound to marker appearance by using the `MarkerTemplateSelector`. It allows you to choose a different data template for each marker, as well as to customize the appearance of a particular marker based on certain conditions.
158+
You can customize the marker appearance by using the [`MarkerTemplateSelector`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.MapLayer.html#Syncfusion_UI_Xaml_Maps_MapLayer_MarkerTemplateSelector) property of [`ImageryLayer`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.ImageryLayer.html) and [`ShapeFileLayer`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.ShapeFileLayer.html) in the [`SfMap`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.SfMap.html). The `DataTemplateSelector` can choose a `DataTemplate` at runtime based on the value of a data-bound to marker appearance by using the [`MarkerTemplateSelector`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.MapLayer.html#Syncfusion_UI_Xaml_Maps_MapLayer_MarkerTemplateSelector). It allows you to choose a different data template for each marker, as well as to customize the appearance of a particular marker based on certain conditions.
163159

164160
{% tabs %}
165-
{% highlight xaml hl_lines="30 33" %}
161+
{% highlight xaml hl_lines="31 34" %}
166162

167-
<Grid>
168-
<Grid.Resources>
169-
<DataTemplate x:Key="AsiaRegionMarkerTemplate">
170-
<Grid>
163+
<Grid>
164+
<Grid.Resources>
165+
<DataTemplate x:Key="AsiaRegionMarkerTemplate">
166+
<Grid>
171167
<Canvas>
172168
<Ellipse Width="15" Height="15" Fill="Red"/>
173169
<TextBlock HorizontalAlignment="Center" Margin="0,20,0,0" FontSize="15" FontFamily="Segoe UI" Text="{Binding Label}"/>
174170
</Canvas>
175-
</Grid>
176-
</DataTemplate>
177-
<DataTemplate x:Key="SouthAmericaRegionMarkerTemplate">
178-
<Grid>
179-
<Canvas>
180-
<Ellipse Width="15" Height="15" Fill="Blue"/>
181-
<TextBlock HorizontalAlignment="Center" Margin="0,20,0,0" FontSize="15" FontFamily="Segoe UI" Text="{Binding Label}"/>
182-
</Canvas>
183-
</Grid>
184-
</DataTemplate>
185-
<local:MarkerTemplateSelector x:Key="markerTemplateSelector"
186-
AsiaMarkerTemplate="{StaticResource AsiaRegionMarkerTemplate}"
187-
SouthAmericaMarkerTemplate="{StaticResource SouthAmericaRegionMarkerTemplate}"/>
188-
</Grid.Resources>
189-
190-
<Grid.DataContext>
191-
<local:MapsViewModel />
192-
</Grid.DataContext>
193-
194-
<syncfusion:SfMap>
195-
<syncfusion:SfMap.Layers>
196-
<syncfusion:ImageryLayer LayerType="OSM"
197-
MarkerTemplateSelector="{StaticResource markerTemplateSelector}"
198-
Markers="{Binding Markers}"/>
199-
<syncfusion:ShapeFileLayer Uri="Maps.ShapeFiles.world1.shp"
200-
MarkerTemplateSelector="{StaticResource markerTemplateSelector}"
201-
Markers="{Binding Markers}"/>
171+
</Grid>
172+
</DataTemplate>
173+
<DataTemplate x:Key="SouthAmericaRegionMarkerTemplate">
174+
<Grid>
175+
<Canvas>
176+
<Ellipse Width="15" Height="15" Fill="Blue"/>
177+
<TextBlock HorizontalAlignment="Center" Margin="0,20,0,0" FontSize="15" FontFamily="Segoe UI" Text="{Binding Label}"/>
178+
</Canvas>
179+
</Grid>
180+
</DataTemplate>
181+
<local:MarkerTemplateSelector x:Key="markerTemplateSelector"
182+
AsiaMarkerTemplate="{StaticResource AsiaRegionMarkerTemplate}"
183+
SouthAmericaMarkerTemplate="{StaticResource SouthAmericaRegionMarkerTemplate}"/>
184+
</Grid.Resources>
185+
186+
<Grid.DataContext>
187+
<local:MapsViewModel />
188+
</Grid.DataContext>
189+
190+
<syncfusion:SfMap>
191+
<syncfusion:SfMap.Layers>
192+
<syncfusion:ImageryLayer LayerType="OSM"
193+
MarkerTemplateSelector="{StaticResource markerTemplateSelector}"
194+
Markers="{Binding Markers}"/>
195+
<syncfusion:ShapeFileLayer Uri="Maps.ShapeFiles.world1.shp"
196+
MarkerTemplateSelector="{StaticResource markerTemplateSelector}"
197+
Markers="{Binding Markers}"/>
202198
</syncfusion:SfMap.Layers>
203-
</syncfusion:SfMap>
204-
</Grid>
199+
</syncfusion:SfMap>
200+
</Grid>
205201

206202
{% endhighlight %}
207203
{% highlight c# tabtitle="MarkerTemplateSelector.cs" %}
208-
209-
public class MarkerTemplateSelector : DataTemplateSelector
210-
{
204+
public class MarkerTemplateSelector : DataTemplateSelector
205+
{
211206
public DataTemplate AsiaMarkerTemplate { get; set; }
212207
public DataTemplate SouthAmericaMarkerTemplate { get; set; }
213208

@@ -222,44 +217,40 @@ You can customize the marker appearance by using the `MarkerTemplateSelector` pr
222217
}
223218

224219
return this.SouthAmericaMarkerTemplate;
225-
}
220+
}
226221

227222
return base.SelectTemplate(item, container);
228223
}
229-
}
230-
224+
}
231225
{% endhighlight %}
232226
{% highlight c# tabtitle="MarkerDetails.cs" %}
233-
234-
public class MarkerDetails
235-
{
236-
public string Label { get; set; }
237-
public string Longitude { get; set; }
238-
public string Latitude { get; set; }
239-
}
227+
public class MarkerDetails
228+
{
229+
public string Label { get; set; }
230+
public string Longitude { get; set; }
231+
public string Latitude { get; set; }
232+
}
240233

241234
{% endhighlight %}
242235
{% highlight c# tabtitle="MapsViewModel.cs" %}
243-
244-
public class MapsViewModel
236+
public class MapsViewModel
237+
{
238+
public ObservableCollection<MarkerDetails> Markers { get; set; }
239+
public MapsViewModel()
245240
{
246-
public ObservableCollection<MarkerDetails> Markers { get; set; }
247-
public MapsViewModel()
248-
{
249-
this.Markers = new ObservableCollection<MarkerDetails>();
250-
this.Markers.Add(new MarkerDetails() { Label = "India", Latitude = "21.0000N", Longitude = "78.0000E" });
251-
this.Markers.Add(new MarkerDetails() { Label = "China", Latitude = "35.0000N", Longitude = "103.0000E" });
252-
this.Markers.Add(new MarkerDetails() { Label = "Brazil", Latitude = "15.7833S", Longitude = "47.8667W" });
253-
}
241+
this.Markers = new ObservableCollection<MarkerDetails>();
242+
this.Markers.Add(new MarkerDetails() { Label = "India", Latitude = "21.0000N", Longitude = "78.0000E" });
243+
this.Markers.Add(new MarkerDetails() { Label = "China", Latitude = "35.0000N", Longitude = "103.0000E" });
244+
this.Markers.Add(new MarkerDetails() { Label = "Brazil", Latitude = "15.7833S", Longitude = "47.8667W" });
254245
}
255-
246+
}
256247
{% endhighlight %}
257248
{% endtabs %}
258249

259-
![Marker-template-selector-support-in-WPF-Maps](Marker_images/marker-template-selector-support-in-wpf-maps.png){:width="540" height="280"}
250+
![Marker-template-selector-support-in-WPF-Maps](Marker_images/marker-template-selector-support-in-wpf-maps.png)
260251

261252
N>
262-
* The `DataContext` for both the [`MarkerTemplate`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.ShapeFileLayer.html#Syncfusion_UI_Xaml_Maps_ShapeFileLayer_MarkerTemplate) and `MarkerTemplateSelector` properties of the [`ImageryLayer`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.ImageryLayer.html) and [`ShapeFileLayer`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.ShapeFileLayer.html) in the SfMap is set to [`CustomDataSymbol`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.CustomDataSymbol.html).
253+
* The `DataContext` for both the [`MarkerTemplate`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.ShapeFileLayer.html#Syncfusion_UI_Xaml_Maps_ShapeFileLayer_MarkerTemplate) and [`MarkerTemplateSelector`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.MapLayer.html#Syncfusion_UI_Xaml_Maps_MapLayer_MarkerTemplateSelector) properties of the [`ImageryLayer`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.ImageryLayer.html) and [`ShapeFileLayer`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.ShapeFileLayer.html) in the SfMap is set to [`CustomDataSymbol`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Maps.CustomDataSymbol.html).
263254

264255
## Customizing marker icons
265256

wpf/Scheduler/Month-View.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ this.Schedule.MonthViewSettings.TrailingDaysVisibility = Visibility.Collapsed;
246246

247247
## Change the number of visible weeks
248248

249-
The number of weeks visible in the month view can be changed by setting the `NumberOfVisibleWeeks` property of [MonthViewSettings](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Scheduler.MonthViewSettings.html) in the [`SfScheduler`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Scheduler.html). By default, 6 weeks are visible.
249+
The number of weeks visible in the month view can be changed by setting the [NumberOfVisibleWeeks](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Scheduler.MonthViewSettings.html#Syncfusion_UI_Xaml_Scheduler_MonthViewSettings_NumberOfVisibleWeeks) property of [MonthViewSettings](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Scheduler.MonthViewSettings.html) in the [`SfScheduler`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Scheduler.html). By default, 6 weeks are visible.
250250

251251
{% tabs %}
252252
{% highlight xaml hl_lines="4" %}
@@ -259,15 +259,15 @@ The number of weeks visible in the month view can be changed by setting the `Num
259259
</syncfusion:SfScheduler>
260260

261261
{% endhighlight %}
262-
{% highlight c# hl_lines="2" %}
262+
{% highlight c# hl_lines="2" %}
263263

264264
this.Schedule.ViewType = SchedulerViewType.Month;
265265
this.Schedule.MonthViewSettings.NumberOfVisibleWeeks = 3;
266266

267267
{% endhighlight %}
268268
{% endtabs %}
269269

270-
![Number-of-visible-weeks-in-month-view-in-WPF-Scheduler](Month-View_Images/number-of-visible-weeks-in-month-view-in-wpf-scheduler.webp){:width="540" height="300"}
270+
![Number-of-visible-weeks-in-month-view-in-WPF-Scheduler](Month-View_Images/number-of-visible-weeks-in-month-view-in-wpf-scheduler.webp)
271271

272272
N>
273273
* The week number range is limited to values between 1 and 6. Any value outside this range will cause the `NumberOfVisibleWeeks` to default to 6.

0 commit comments

Comments
 (0)