-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Toggle binds can be used to display a specific page/display when a button is pressed, but returns to the previous page. A use case for this could be the Brake Magic feature on Mercedes F1 cars, where a screen displaying brake temperatures is displayed temporarily until it is de-activated.
- Loading branch information
Showing
7 changed files
with
119 additions
and
13 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
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
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
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,34 @@ | ||
<UserControl x:Class="SwitchableProperties.ToggleBind" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:SwitchableProperties" | ||
xmlns:ui="clr-namespace:SimHub.Plugins.UI;assembly=SimHub.Plugins" | ||
xmlns:styles="clr-namespace:SimHub.Plugins.Styles;assembly=SimHub.Plugins" | ||
mc:Ignorable="d" | ||
d:DesignHeight="30" d:DesignWidth="800"> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto"/> | ||
<ColumnDefinition/> | ||
<ColumnDefinition Width="Auto"/> | ||
<ColumnDefinition/> | ||
<ColumnDefinition Width="0.5*"/> | ||
<ColumnDefinition Width="Auto"/> | ||
</Grid.ColumnDefinitions> | ||
<Label Grid.Row="0" Grid.Column="0" Content="Bind Name" HorizontalAlignment="Left" VerticalAlignment="Center"/> | ||
<Label Grid.Row="0" Grid.Column="2" Content="Toggle Value" HorizontalAlignment="Left" VerticalAlignment="Center"/> | ||
<TextBox x:Name="txtBindName" Grid.Row="0" Grid.Column="1" TextWrapping="NoWrap" Text="{Binding ActionName}" Margin="5,2,20,2" VerticalContentAlignment="Center"/> | ||
<TextBox x:Name="txtBindValue" Grid.Row="0" Grid.Column="3" TextWrapping="NoWrap" Text="{Binding PropertyValue}" Margin="5,2,6,2" VerticalContentAlignment="Center"/> | ||
<ui:ControlsEditor Grid.Row="0" Grid.Column="4"> | ||
<ui:ControlsEditor.ActionName> | ||
<MultiBinding StringFormat='SwitchablePropertiesPlugin.{0}_{1}'> | ||
<Binding Path="DataContext.PropertyName" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type local:Property}}"/> | ||
<Binding Path="ActionName"/> | ||
</MultiBinding> | ||
</ui:ControlsEditor.ActionName> | ||
</ui:ControlsEditor> | ||
<styles:SHButtonPrimary Grid.Row="0" Grid.Column="5" x:Name="btnDelete" Command="{x:Static local:Property.DeleteBindCommand}" CommandParameter="{Binding DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Bind}}}" HorizontalAlignment="Right" VerticalAlignment="Center">Delete</styles:SHButtonPrimary> | ||
</Grid> | ||
</UserControl> |
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,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Navigation; | ||
using System.Windows.Shapes; | ||
|
||
namespace SwitchableProperties | ||
{ | ||
/// <summary> | ||
/// Interaction logic for ToggleBind.xaml | ||
/// </summary> | ||
public partial class ToggleBind : UserControl | ||
{ | ||
public ToggleBind() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |