Hide the Edit Variables button when no variables are available (#823)
This commit is contained in:
parent
603d672015
commit
f395d14764
@ -15,6 +15,9 @@
|
|||||||
|
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
|
|
||||||
|
<converters:ItemSizeToVisibilityConverter x:Key="ItemSizeToVisibilityConverter"/>
|
||||||
|
|
||||||
<Style x:Key="GraphButtonStyle" TargetType="Button">
|
<Style x:Key="GraphButtonStyle" TargetType="Button">
|
||||||
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
|
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
|
||||||
<Setter Property="Background" Value="{ThemeResource AppControlTransparentButtonBackgroundBrush}"/>
|
<Setter Property="Background" Value="{ThemeResource AppControlTransparentButtonBackgroundBrush}"/>
|
||||||
@ -370,9 +373,9 @@
|
|||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
Style="{ThemeResource ThemedSwitchModeToggleButtonStyle}"
|
Style="{ThemeResource ThemedSwitchModeToggleButtonStyle}"
|
||||||
AutomationProperties.AutomationId="SwitchModeToggleButton"
|
AutomationProperties.AutomationId="SwitchModeToggleButton"
|
||||||
AutomationProperties.Name="{x:Bind GetInfoForSwitchModeToggleButton(SwitchModeToggleButton.IsChecked.Value), Mode=OneWay}"
|
AutomationProperties.Name="{x:Bind local:GraphingCalculator.GetInfoForSwitchModeToggleButton(SwitchModeToggleButton.IsChecked.Value), Mode=OneWay}"
|
||||||
Checked="SwitchModeToggleButton_Checked"
|
Checked="SwitchModeToggleButton_Checked"
|
||||||
ToolTipService.ToolTip="{x:Bind GetInfoForSwitchModeToggleButton(SwitchModeToggleButton.IsChecked.Value), Mode=OneWay}"
|
ToolTipService.ToolTip="{x:Bind local:GraphingCalculator.GetInfoForSwitchModeToggleButton(SwitchModeToggleButton.IsChecked.Value), Mode=OneWay}"
|
||||||
Unchecked="SwitchModeToggleButton_Checked"
|
Unchecked="SwitchModeToggleButton_Checked"
|
||||||
Visibility="Collapsed">
|
Visibility="Collapsed">
|
||||||
<!-- TODO: update this icon -->
|
<!-- TODO: update this icon -->
|
||||||
@ -399,7 +402,6 @@
|
|||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Orientation="Horizontal">
|
Orientation="Horizontal">
|
||||||
|
|
||||||
<!-- Temporary button until the final UI is created -->
|
<!-- Temporary button until the final UI is created -->
|
||||||
<Button x:Name="VariableEditing"
|
<Button x:Name="VariableEditing"
|
||||||
x:Uid="variablesButton"
|
x:Uid="variablesButton"
|
||||||
@ -407,7 +409,8 @@
|
|||||||
MinHeight="44"
|
MinHeight="44"
|
||||||
Margin="0,0,4,0"
|
Margin="0,0,4,0"
|
||||||
Style="{StaticResource GraphButtonStyle}"
|
Style="{StaticResource GraphButtonStyle}"
|
||||||
RequestedTheme="Light">
|
RequestedTheme="Light"
|
||||||
|
Visibility="{x:Bind local:GraphingCalculator.ManageEditVariablesButtonVisibility(ViewModel.Variables.Size), Mode=OneWay}">
|
||||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
||||||
<Button.Flyout>
|
<Button.Flyout>
|
||||||
<Flyout Placement="BottomEdgeAlignedLeft">
|
<Flyout Placement="BottomEdgeAlignedLeft">
|
||||||
@ -688,7 +691,7 @@
|
|||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.RowSpan="2"
|
Grid.RowSpan="2"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Visibility="{x:Bind ShouldDisplayPanel(IsSmallState, SwitchModeToggleButton.IsChecked.Value, x:False), Mode=OneWay}">
|
Visibility="{x:Bind local:GraphingCalculator.ShouldDisplayPanel(IsSmallState, SwitchModeToggleButton.IsChecked.Value, x:False), Mode=OneWay}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="5*"/>
|
<RowDefinition Height="5*"/>
|
||||||
<RowDefinition Height="3*"/>
|
<RowDefinition Height="3*"/>
|
||||||
|
@ -447,3 +447,7 @@ void GraphingCalculator::TraceValuePopup_SizeChanged(Platform::Object ^ sender,
|
|||||||
{
|
{
|
||||||
PositionGraphPopup();
|
PositionGraphPopup();
|
||||||
}
|
}
|
||||||
|
::Visibility GraphingCalculator::ManageEditVariablesButtonVisibility(unsigned int numberOfVariables)
|
||||||
|
{
|
||||||
|
return numberOfVariables == 0 ? ::Visibility::Collapsed : ::Visibility::Visible;
|
||||||
|
}
|
||||||
|
@ -32,8 +32,9 @@ public ref class GraphingCalculator sealed : public Windows::UI::Xaml::Data::INo
|
|||||||
void set(CalculatorApp::ViewModel::GraphingCalculatorViewModel^ vm);
|
void set(CalculatorApp::ViewModel::GraphingCalculatorViewModel^ vm);
|
||||||
}
|
}
|
||||||
|
|
||||||
Windows::UI::Xaml::Visibility ShouldDisplayPanel(bool isSmallState, bool isEquationModeActivated, bool isGraphPanel);
|
static Windows::UI::Xaml::Visibility ShouldDisplayPanel(bool isSmallState, bool isEquationModeActivated, bool isGraphPanel);
|
||||||
Platform::String ^ GetInfoForSwitchModeToggleButton(bool isChecked);
|
static Platform::String ^ GetInfoForSwitchModeToggleButton(bool isChecked);
|
||||||
|
static Windows::UI::Xaml::Visibility ManageEditVariablesButtonVisibility(unsigned int numberOfVariables);
|
||||||
private:
|
private:
|
||||||
void GraphingCalculator_DataContextChanged(Windows::UI::Xaml::FrameworkElement ^ sender, Windows::UI::Xaml::DataContextChangedEventArgs ^ args);
|
void GraphingCalculator_DataContextChanged(Windows::UI::Xaml::FrameworkElement ^ sender, Windows::UI::Xaml::DataContextChangedEventArgs ^ args);
|
||||||
|
|
||||||
@ -59,7 +60,6 @@ public ref class GraphingCalculator sealed : public Windows::UI::Xaml::Data::INo
|
|||||||
|
|
||||||
void OnShowTracePopupChanged(bool newValue);
|
void OnShowTracePopupChanged(bool newValue);
|
||||||
void OnTracePointChanged(Windows::Foundation::Point newPoint);
|
void OnTracePointChanged(Windows::Foundation::Point newPoint);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Windows::Foundation::EventRegistrationToken m_dataRequestedToken;
|
Windows::Foundation::EventRegistrationToken m_dataRequestedToken;
|
||||||
Windows::Foundation::EventRegistrationToken m_vectorChangedToken;
|
Windows::Foundation::EventRegistrationToken m_vectorChangedToken;
|
||||||
|
Loading…
Reference in New Issue
Block a user