ux:
<App Theme="Basic" ClearColor="#eeeeeeff">
<DockPanel>
<StatusBarBackground DockPanel.Dock="Top" />
<ScrollViewer ClipToBounds="true">
<StackPanel>
<Switch ux:Name="switchA" ToggledChanged="example" Toggled="true"/>
<Switch ux:Name="switchB" ToggledChanged="example"/>
</StackPanel>
</ScrollViewer>
</DockPanel>
</App>
Uno:
using Uno;
using Fuse;
using Fuse.Triggers;
using Fuse.Controls;
using Fuse.Gestures;
public partial class MainView
{
string enabledT ="switchA";
void example(object sender, EventArgs args) {
Switch origin = (Switch) sender;
Switch enabled = switchA;
if (origin.Toggled == true) {
if (enabledT == "switchA") {
enabled = switchA;
} else if (enabledT == "switchB") {
enabled = switchB;
}
if (origin.Equals(switchA)) {
enabled.Toggled = false;
enabled = switchA;
} else if (origin.Equals(switchB)) {
enabled.Toggled = false;
enabled = switchB;
}
} else {
switchA.Toggled = true;
}
}
}
If you toggle the bottom switch, Fuse will crash to desktop without any error message.