-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
10,174 additions
and
6,271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
dev/DevWinUI.Gallery/Views/Pages/Features/CirclePanelPage.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<Page x:Class="DevWinUIGallery.Views.CirclePanelPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:dev="using:DevWinUI" | ||
xmlns:local="using:DevWinUIGallery" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<ScrollViewer> | ||
<StackPanel Margin="10" | ||
dev:PanelAttach.ChildrenTransitions="Default" | ||
Spacing="10"> | ||
<local:ControlExample DocPage="controls/circlePanel" | ||
HeaderText="CirclePanel"> | ||
<local:ControlExample.Xaml> | ||
<x:String><dev:CirclePanel /></x:String> | ||
</local:ControlExample.Xaml> | ||
<local:ControlExample.Pane> | ||
<StackPanel Spacing="10"> | ||
<ToggleSwitch x:Name="TGKeepVertical" | ||
Header="KeepVertical" | ||
IsOn="True" | ||
Toggled="TGKeepVertical_Toggled" /> | ||
<NumberBox x:Name="NBDiameter" | ||
Header="Diameter" | ||
Minimum="100" | ||
SpinButtonPlacementMode="Inline" | ||
ValueChanged="OnValueChanged" | ||
Value="170" /> | ||
<NumberBox x:Name="NBOffset" | ||
Header="OffsetAngle" | ||
Minimum="0" | ||
SpinButtonPlacementMode="Inline" | ||
ValueChanged="OnValueChanged" | ||
Value="0" /> | ||
</StackPanel> | ||
</local:ControlExample.Pane> | ||
<dev:CirclePanel x:Name="CirclePanelSample" | ||
Diameter="{x:Bind NBDiameter.Value, Mode=OneWay}" | ||
KeepVertical="{x:Bind TGKeepVertical.IsOn, Mode=OneWay}" | ||
OffsetAngle="{x:Bind NBOffset.Value, Mode=OneWay}"> | ||
<dev:ClockRadioButton Content="3" /> | ||
<dev:ClockRadioButton Content="4" /> | ||
<dev:ClockRadioButton Content="5" /> | ||
<dev:ClockRadioButton Content="6" /> | ||
<dev:ClockRadioButton Content="7" /> | ||
<dev:ClockRadioButton Content="8" /> | ||
<dev:ClockRadioButton Content="9" /> | ||
<dev:ClockRadioButton Content="10" /> | ||
<dev:ClockRadioButton Content="11" /> | ||
<dev:ClockRadioButton Content="12" /> | ||
<dev:ClockRadioButton Content="1" /> | ||
<dev:ClockRadioButton Content="2" /> | ||
</dev:CirclePanel> | ||
</local:ControlExample> | ||
<local:ControlExample DocPage="controls/circlePanel" | ||
HeaderText="CirclePanel"> | ||
<local:ControlExample.Xaml> | ||
<x:String><dev:CirclePanel /></x:String> | ||
</local:ControlExample.Xaml> | ||
<local:ControlExample.Pane> | ||
<StackPanel Spacing="10"> | ||
<ToggleSwitch x:Name="TGKeepVertical2" | ||
Header="KeepVertical" | ||
IsOn="True" | ||
Toggled="TGKeepVertical2_Toggled" /> | ||
<NumberBox x:Name="NBDiameter2" | ||
Header="Diameter" | ||
Minimum="100" | ||
SpinButtonPlacementMode="Inline" | ||
ValueChanged="OnValueChanged2" | ||
Value="170" /> | ||
<NumberBox x:Name="NBOffset2" | ||
Header="OffsetAngle" | ||
Minimum="0" | ||
SpinButtonPlacementMode="Inline" | ||
ValueChanged="OnValueChanged2" | ||
Value="0" /> | ||
<Button x:Name="BtnAdd" | ||
Click="BtnAdd_Click" | ||
Content="Add Item" /> | ||
<Button x:Name="BtnRemove" | ||
Click="BtnRemove_Click" | ||
Content="Remove Item" /> | ||
</StackPanel> | ||
</local:ControlExample.Pane> | ||
<dev:CirclePanel x:Name="CirclePanelSample2" | ||
Diameter="{x:Bind NBDiameter2.Value, Mode=OneWay}" | ||
KeepVertical="{x:Bind TGKeepVertical2.IsOn, Mode=OneWay}" | ||
OffsetAngle="{x:Bind NBOffset2.Value, Mode=OneWay}" /> | ||
</local:ControlExample> | ||
</StackPanel> | ||
</ScrollViewer> | ||
</Page> |
57 changes: 57 additions & 0 deletions
57
dev/DevWinUI.Gallery/Views/Pages/Features/CirclePanelPage.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
namespace DevWinUIGallery.Views; | ||
|
||
public sealed partial class CirclePanelPage : Page | ||
{ | ||
private int currentIndex = 0; | ||
public CirclePanelPage() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private void BtnAdd_Click(object sender, RoutedEventArgs e) | ||
{ | ||
currentIndex += 1; | ||
CirclePanelSample2.Children.Add(new ClockRadioButton { Content = $"{currentIndex}" }); | ||
} | ||
|
||
private void BtnRemove_Click(object sender, RoutedEventArgs e) | ||
{ | ||
var item = CirclePanelSample2.Children.LastOrDefault(); | ||
if (item != null) | ||
{ | ||
CirclePanelSample2.Children.Remove(item); | ||
currentIndex -= 1; | ||
} | ||
} | ||
|
||
private void TGKeepVertical_Toggled(object sender, RoutedEventArgs e) | ||
{ | ||
UpdateCirclePanelSampleTemplate(); | ||
} | ||
|
||
private void OnValueChanged(NumberBox sender, NumberBoxValueChangedEventArgs args) | ||
{ | ||
UpdateCirclePanelSampleTemplate(); | ||
} | ||
|
||
private void UpdateCirclePanelSampleTemplate() | ||
{ | ||
CirclePanelSample?.InvalidateArrange(); | ||
CirclePanelSample?.InvalidateMeasure(); | ||
} | ||
private void UpdateCirclePanelSample2Template() | ||
{ | ||
CirclePanelSample2?.InvalidateArrange(); | ||
CirclePanelSample2?.InvalidateMeasure(); | ||
} | ||
|
||
private void TGKeepVertical2_Toggled(object sender, RoutedEventArgs e) | ||
{ | ||
UpdateCirclePanelSample2Template(); | ||
} | ||
|
||
private void OnValueChanged2(NumberBox sender, NumberBoxValueChangedEventArgs args) | ||
{ | ||
UpdateCirclePanelSample2Template(); | ||
} | ||
} |