Skip to content

Commit a9600f7

Browse files
committed
update
1 parent 8cab7cd commit a9600f7

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

StockChart/StockChart/MainPage.xaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@
1010
<ContentPage.BindingContext>
1111
<local:StockViewModel x:Name="viewModel"></local:StockViewModel>
1212
</ContentPage.BindingContext>
13-
14-
<Border Margin="15" StrokeThickness="2" Stroke="#79747E">
15-
16-
<Border.StrokeShape>
17-
<RoundRectangle CornerRadius="10"/>
18-
</Border.StrokeShape>
13+
14+
<ContentPage.Resources>
15+
<Style x:Key="PlatformSpecificBorder" TargetType="Border">
16+
<Setter Property="Margin" Value="15" />
17+
<Setter Property="StrokeThickness" Value="2" />
18+
<Setter Property="Stroke" Value="#79747E" />
19+
<Setter Property="StrokeShape">
20+
<RoundRectangle CornerRadius="10"/>
21+
</Setter>
22+
</Style>
23+
</ContentPage.Resources>
24+
25+
<Border x:Name="MyBorder">
1926

2027
<Grid ColumnDefinitions="*,*" Margin="10,-10,20,15" >
2128

StockChart/StockChart/MainPage.xaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ public partial class MainPage : ContentPage
88
public MainPage()
99
{
1010
InitializeComponent();
11+
if(DeviceInfo.Platform == DevicePlatform.WinUI || DeviceInfo.Platform == DevicePlatform.MacCatalyst)
12+
{
13+
MyBorder.Style = (Style)Resources["PlatformSpecificBorder"];
14+
}
1115
}
1216
private void SfSegmentedControl_SelectionChanged(object sender, Syncfusion.Maui.Toolkit.SegmentedControl.SelectionChangedEventArgs e)
1317
{

0 commit comments

Comments
 (0)