Add preview tag to Graphing feature (#907)
* Add preview tag to Graphing * Fix Graph Settings button in dark mode
This commit is contained in:
parent
4ac76c66da
commit
f9c049a84b
@ -58,6 +58,7 @@ void ApplicationViewModel::Mode::set(ViewMode value)
|
|||||||
{
|
{
|
||||||
PreviousMode = m_mode;
|
PreviousMode = m_mode;
|
||||||
m_mode = value;
|
m_mode = value;
|
||||||
|
IsModePreview = NavCategory::IsViewModePreview(m_mode);
|
||||||
SetDisplayNormalAlwaysOnTopOption();
|
SetDisplayNormalAlwaysOnTopOption();
|
||||||
OnModeChanged();
|
OnModeChanged();
|
||||||
RaisePropertyChanged(ModePropertyName);
|
RaisePropertyChanged(ModePropertyName);
|
||||||
|
@ -26,6 +26,7 @@ namespace CalculatorApp
|
|||||||
OBSERVABLE_PROPERTY_RW(UnitConverterViewModel ^, ConverterViewModel);
|
OBSERVABLE_PROPERTY_RW(UnitConverterViewModel ^, ConverterViewModel);
|
||||||
OBSERVABLE_PROPERTY_RW(CalculatorApp::Common::ViewMode, PreviousMode);
|
OBSERVABLE_PROPERTY_RW(CalculatorApp::Common::ViewMode, PreviousMode);
|
||||||
OBSERVABLE_PROPERTY_R(bool, IsAlwaysOnTop);
|
OBSERVABLE_PROPERTY_R(bool, IsAlwaysOnTop);
|
||||||
|
OBSERVABLE_PROPERTY_R(bool, IsModePreview);
|
||||||
OBSERVABLE_NAMED_PROPERTY_RW(Platform::String ^, CategoryName);
|
OBSERVABLE_NAMED_PROPERTY_RW(Platform::String ^, CategoryName);
|
||||||
|
|
||||||
// Indicates whether calculator is currently in standard mode _and_ supports CompactOverlay _and_ is not in Always-on-Top mode
|
// Indicates whether calculator is currently in standard mode _and_ supports CompactOverlay _and_ is not in Always-on-Top mode
|
||||||
|
@ -118,7 +118,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
MyVirtualKey::Number1,
|
MyVirtualKey::Number1,
|
||||||
L"1",
|
L"1",
|
||||||
SUPPORTS_ALL,
|
SUPPORTS_ALL,
|
||||||
true },
|
true,
|
||||||
|
false },
|
||||||
NavCategoryInitializer{ ViewMode::Scientific,
|
NavCategoryInitializer{ ViewMode::Scientific,
|
||||||
SCIENTIFIC_ID,
|
SCIENTIFIC_ID,
|
||||||
L"Scientific",
|
L"Scientific",
|
||||||
@ -128,7 +129,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
MyVirtualKey::Number2,
|
MyVirtualKey::Number2,
|
||||||
L"2",
|
L"2",
|
||||||
SUPPORTS_ALL,
|
SUPPORTS_ALL,
|
||||||
true } };
|
true,
|
||||||
|
false } };
|
||||||
|
|
||||||
int currentIndex = 3;
|
int currentIndex = 3;
|
||||||
bool supportGraphingCalculator = IsGraphingModeAvailable();
|
bool supportGraphingCalculator = IsGraphingModeAvailable();
|
||||||
@ -144,7 +146,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
MyVirtualKey::Number3,
|
MyVirtualKey::Number3,
|
||||||
L"3",
|
L"3",
|
||||||
SUPPORTS_ALL,
|
SUPPORTS_ALL,
|
||||||
isEnabled });
|
isEnabled,
|
||||||
|
true });
|
||||||
++currentIndex;
|
++currentIndex;
|
||||||
}
|
}
|
||||||
res.insert(
|
res.insert(
|
||||||
@ -158,7 +161,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
supportGraphingCalculator ? MyVirtualKey::Number4 : MyVirtualKey::Number3,
|
supportGraphingCalculator ? MyVirtualKey::Number4 : MyVirtualKey::Number3,
|
||||||
towchar_t(currentIndex++),
|
towchar_t(currentIndex++),
|
||||||
SUPPORTS_ALL,
|
SUPPORTS_ALL,
|
||||||
true },
|
true,
|
||||||
|
false },
|
||||||
NavCategoryInitializer{ ViewMode::Date,
|
NavCategoryInitializer{ ViewMode::Date,
|
||||||
DATE_ID,
|
DATE_ID,
|
||||||
L"Date",
|
L"Date",
|
||||||
@ -168,7 +172,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
supportGraphingCalculator ? MyVirtualKey::Number5 : MyVirtualKey::Number4,
|
supportGraphingCalculator ? MyVirtualKey::Number5 : MyVirtualKey::Number4,
|
||||||
towchar_t(currentIndex++),
|
towchar_t(currentIndex++),
|
||||||
SUPPORTS_ALL,
|
SUPPORTS_ALL,
|
||||||
true },
|
true,
|
||||||
|
false },
|
||||||
NavCategoryInitializer{ ViewMode::Currency,
|
NavCategoryInitializer{ ViewMode::Currency,
|
||||||
CURRENCY_ID,
|
CURRENCY_ID,
|
||||||
L"Currency",
|
L"Currency",
|
||||||
@ -178,7 +183,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
MyVirtualKey::None,
|
MyVirtualKey::None,
|
||||||
nullptr,
|
nullptr,
|
||||||
POSITIVE_ONLY,
|
POSITIVE_ONLY,
|
||||||
true },
|
true,
|
||||||
|
false },
|
||||||
NavCategoryInitializer{ ViewMode::Volume,
|
NavCategoryInitializer{ ViewMode::Volume,
|
||||||
VOLUME_ID,
|
VOLUME_ID,
|
||||||
L"Volume",
|
L"Volume",
|
||||||
@ -188,7 +194,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
MyVirtualKey::None,
|
MyVirtualKey::None,
|
||||||
nullptr,
|
nullptr,
|
||||||
POSITIVE_ONLY,
|
POSITIVE_ONLY,
|
||||||
true },
|
true,
|
||||||
|
false },
|
||||||
NavCategoryInitializer{ ViewMode::Length,
|
NavCategoryInitializer{ ViewMode::Length,
|
||||||
LENGTH_ID,
|
LENGTH_ID,
|
||||||
L"Length",
|
L"Length",
|
||||||
@ -198,7 +205,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
MyVirtualKey::None,
|
MyVirtualKey::None,
|
||||||
nullptr,
|
nullptr,
|
||||||
POSITIVE_ONLY,
|
POSITIVE_ONLY,
|
||||||
true },
|
true,
|
||||||
|
false },
|
||||||
NavCategoryInitializer{ ViewMode::Weight,
|
NavCategoryInitializer{ ViewMode::Weight,
|
||||||
WEIGHT_ID,
|
WEIGHT_ID,
|
||||||
L"Weight and Mass",
|
L"Weight and Mass",
|
||||||
@ -208,7 +216,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
MyVirtualKey::None,
|
MyVirtualKey::None,
|
||||||
nullptr,
|
nullptr,
|
||||||
POSITIVE_ONLY,
|
POSITIVE_ONLY,
|
||||||
true },
|
true,
|
||||||
|
false },
|
||||||
NavCategoryInitializer{ ViewMode::Temperature,
|
NavCategoryInitializer{ ViewMode::Temperature,
|
||||||
TEMPERATURE_ID,
|
TEMPERATURE_ID,
|
||||||
L"Temperature",
|
L"Temperature",
|
||||||
@ -218,7 +227,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
MyVirtualKey::None,
|
MyVirtualKey::None,
|
||||||
nullptr,
|
nullptr,
|
||||||
SUPPORTS_NEGATIVE,
|
SUPPORTS_NEGATIVE,
|
||||||
true },
|
true,
|
||||||
|
false },
|
||||||
NavCategoryInitializer{ ViewMode::Energy,
|
NavCategoryInitializer{ ViewMode::Energy,
|
||||||
ENERGY_ID,
|
ENERGY_ID,
|
||||||
L"Energy",
|
L"Energy",
|
||||||
@ -228,7 +238,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
MyVirtualKey::None,
|
MyVirtualKey::None,
|
||||||
nullptr,
|
nullptr,
|
||||||
POSITIVE_ONLY,
|
POSITIVE_ONLY,
|
||||||
true },
|
true,
|
||||||
|
false },
|
||||||
NavCategoryInitializer{ ViewMode::Area,
|
NavCategoryInitializer{ ViewMode::Area,
|
||||||
AREA_ID,
|
AREA_ID,
|
||||||
L"Area",
|
L"Area",
|
||||||
@ -238,7 +249,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
MyVirtualKey::None,
|
MyVirtualKey::None,
|
||||||
nullptr,
|
nullptr,
|
||||||
POSITIVE_ONLY,
|
POSITIVE_ONLY,
|
||||||
true },
|
true,
|
||||||
|
false },
|
||||||
NavCategoryInitializer{ ViewMode::Speed,
|
NavCategoryInitializer{ ViewMode::Speed,
|
||||||
SPEED_ID,
|
SPEED_ID,
|
||||||
L"Speed",
|
L"Speed",
|
||||||
@ -248,7 +260,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
MyVirtualKey::None,
|
MyVirtualKey::None,
|
||||||
nullptr,
|
nullptr,
|
||||||
POSITIVE_ONLY,
|
POSITIVE_ONLY,
|
||||||
true },
|
true,
|
||||||
|
false },
|
||||||
NavCategoryInitializer{ ViewMode::Time,
|
NavCategoryInitializer{ ViewMode::Time,
|
||||||
TIME_ID,
|
TIME_ID,
|
||||||
L"Time",
|
L"Time",
|
||||||
@ -258,7 +271,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
MyVirtualKey::None,
|
MyVirtualKey::None,
|
||||||
nullptr,
|
nullptr,
|
||||||
POSITIVE_ONLY,
|
POSITIVE_ONLY,
|
||||||
true },
|
true,
|
||||||
|
false },
|
||||||
NavCategoryInitializer{ ViewMode::Power,
|
NavCategoryInitializer{ ViewMode::Power,
|
||||||
POWER_ID,
|
POWER_ID,
|
||||||
L"Power",
|
L"Power",
|
||||||
@ -268,7 +282,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
MyVirtualKey::None,
|
MyVirtualKey::None,
|
||||||
nullptr,
|
nullptr,
|
||||||
SUPPORTS_NEGATIVE,
|
SUPPORTS_NEGATIVE,
|
||||||
true },
|
true,
|
||||||
|
false },
|
||||||
NavCategoryInitializer{ ViewMode::Data,
|
NavCategoryInitializer{ ViewMode::Data,
|
||||||
DATA_ID,
|
DATA_ID,
|
||||||
L"Data",
|
L"Data",
|
||||||
@ -278,7 +293,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
MyVirtualKey::None,
|
MyVirtualKey::None,
|
||||||
nullptr,
|
nullptr,
|
||||||
POSITIVE_ONLY,
|
POSITIVE_ONLY,
|
||||||
true },
|
true,
|
||||||
|
false },
|
||||||
NavCategoryInitializer{ ViewMode::Pressure,
|
NavCategoryInitializer{ ViewMode::Pressure,
|
||||||
PRESSURE_ID,
|
PRESSURE_ID,
|
||||||
L"Pressure",
|
L"Pressure",
|
||||||
@ -288,7 +304,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
MyVirtualKey::None,
|
MyVirtualKey::None,
|
||||||
nullptr,
|
nullptr,
|
||||||
POSITIVE_ONLY,
|
POSITIVE_ONLY,
|
||||||
true },
|
true,
|
||||||
|
false },
|
||||||
NavCategoryInitializer{ ViewMode::Angle,
|
NavCategoryInitializer{ ViewMode::Angle,
|
||||||
ANGLE_ID,
|
ANGLE_ID,
|
||||||
L"Angle",
|
L"Angle",
|
||||||
@ -298,7 +315,8 @@ static const list<NavCategoryInitializer> s_categoryManifest = [] {
|
|||||||
MyVirtualKey::None,
|
MyVirtualKey::None,
|
||||||
nullptr,
|
nullptr,
|
||||||
SUPPORTS_NEGATIVE,
|
SUPPORTS_NEGATIVE,
|
||||||
true } });
|
true,
|
||||||
|
false } });
|
||||||
return res;
|
return res;
|
||||||
}();
|
}();
|
||||||
|
|
||||||
@ -522,7 +540,8 @@ NavCategoryGroup::NavCategoryGroup(const NavCategoryGroupInitializer& groupIniti
|
|||||||
groupMode,
|
groupMode,
|
||||||
categoryInitializer.viewMode,
|
categoryInitializer.viewMode,
|
||||||
categoryInitializer.supportsNegative,
|
categoryInitializer.supportsNegative,
|
||||||
categoryInitializer.isEnabled));
|
categoryInitializer.isEnabled,
|
||||||
|
categoryInitializer.isPreview));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -546,3 +565,15 @@ NavCategoryGroup ^ NavCategoryGroup::CreateConverterCategory()
|
|||||||
return ref new NavCategoryGroup(
|
return ref new NavCategoryGroup(
|
||||||
NavCategoryGroupInitializer{ CategoryGroupType::Converter, L"ConverterModeTextCaps", L"ConverterModeText", L"ConverterModePluralText" });
|
NavCategoryGroupInitializer{ CategoryGroupType::Converter, L"ConverterModeTextCaps", L"ConverterModeText", L"ConverterModePluralText" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool NavCategory::IsViewModePreview(ViewMode mode)
|
||||||
|
{
|
||||||
|
auto iter =
|
||||||
|
find_if(begin(s_categoryManifest), end(s_categoryManifest), [mode](const NavCategoryInitializer& initializer) { return initializer.viewMode == mode; });
|
||||||
|
|
||||||
|
if (iter != s_categoryManifest.end())
|
||||||
|
{
|
||||||
|
return iter->isPreview;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@ -69,7 +69,8 @@ namespace CalculatorApp
|
|||||||
MyVirtualKey vKey,
|
MyVirtualKey vKey,
|
||||||
wchar_t const* aKey,
|
wchar_t const* aKey,
|
||||||
bool categorySupportsNegative,
|
bool categorySupportsNegative,
|
||||||
bool enabled)
|
bool enabled,
|
||||||
|
bool isPreview)
|
||||||
: viewMode(mode)
|
: viewMode(mode)
|
||||||
, serializationId(id)
|
, serializationId(id)
|
||||||
, friendlyName(name)
|
, friendlyName(name)
|
||||||
@ -80,6 +81,7 @@ namespace CalculatorApp
|
|||||||
, accessKey(aKey)
|
, accessKey(aKey)
|
||||||
, supportsNegative(categorySupportsNegative)
|
, supportsNegative(categorySupportsNegative)
|
||||||
, isEnabled(enabled)
|
, isEnabled(enabled)
|
||||||
|
, isPreview(isPreview)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,6 +95,7 @@ namespace CalculatorApp
|
|||||||
const wchar_t* const accessKey;
|
const wchar_t* const accessKey;
|
||||||
const bool supportsNegative;
|
const bool supportsNegative;
|
||||||
const bool isEnabled;
|
const bool isEnabled;
|
||||||
|
const bool isPreview;
|
||||||
};
|
};
|
||||||
|
|
||||||
private
|
private
|
||||||
@ -123,6 +126,7 @@ namespace CalculatorApp
|
|||||||
PROPERTY_R(Platform::String ^, AccessKey);
|
PROPERTY_R(Platform::String ^, AccessKey);
|
||||||
PROPERTY_R(bool, SupportsNegative);
|
PROPERTY_R(bool, SupportsNegative);
|
||||||
PROPERTY_R(bool, IsEnabled);
|
PROPERTY_R(bool, IsEnabled);
|
||||||
|
PROPERTY_R(bool, IsPreview);
|
||||||
|
|
||||||
property Platform::String
|
property Platform::String
|
||||||
^ AutomationId { Platform::String ^ get() { return m_Mode.ToString(); } }
|
^ AutomationId { Platform::String ^ get() { return m_Mode.ToString(); } }
|
||||||
@ -138,7 +142,7 @@ namespace CalculatorApp
|
|||||||
static bool IsGraphingCalculatorViewMode(ViewMode mode);
|
static bool IsGraphingCalculatorViewMode(ViewMode mode);
|
||||||
static bool IsDateCalculatorViewMode(ViewMode mode);
|
static bool IsDateCalculatorViewMode(ViewMode mode);
|
||||||
static bool IsConverterViewMode(ViewMode mode);
|
static bool IsConverterViewMode(ViewMode mode);
|
||||||
|
static bool IsViewModePreview(ViewMode mode);
|
||||||
static Platform::String ^ GetFriendlyName(ViewMode mode);
|
static Platform::String ^ GetFriendlyName(ViewMode mode);
|
||||||
static Platform::String ^ GetNameResourceKey(ViewMode mode);
|
static Platform::String ^ GetNameResourceKey(ViewMode mode);
|
||||||
static CategoryGroupType GetGroupType(ViewMode mode);
|
static CategoryGroupType GetGroupType(ViewMode mode);
|
||||||
@ -159,7 +163,8 @@ namespace CalculatorApp
|
|||||||
Platform::String ^ mode,
|
Platform::String ^ mode,
|
||||||
ViewMode viewMode,
|
ViewMode viewMode,
|
||||||
bool supportsNegative,
|
bool supportsNegative,
|
||||||
bool isEnabled)
|
bool isEnabled,
|
||||||
|
bool isPreview)
|
||||||
: m_Name(name)
|
: m_Name(name)
|
||||||
, m_AutomationName(automationName)
|
, m_AutomationName(automationName)
|
||||||
, m_Glyph(glyph)
|
, m_Glyph(glyph)
|
||||||
@ -168,6 +173,7 @@ namespace CalculatorApp
|
|||||||
, m_Mode(viewMode)
|
, m_Mode(viewMode)
|
||||||
, m_SupportsNegative(supportsNegative)
|
, m_SupportsNegative(supportsNegative)
|
||||||
, m_IsEnabled(isEnabled)
|
, m_IsEnabled(isEnabled)
|
||||||
|
, m_IsPreview(isPreview)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,6 +247,9 @@
|
|||||||
<ClInclude Include="Controls\CalculatorButton.h" />
|
<ClInclude Include="Controls\CalculatorButton.h" />
|
||||||
<ClInclude Include="Controls\FlipButtons.h" />
|
<ClInclude Include="Controls\FlipButtons.h" />
|
||||||
<ClInclude Include="Controls\OverflowTextBlock.h" />
|
<ClInclude Include="Controls\OverflowTextBlock.h" />
|
||||||
|
<ClInclude Include="Controls\PreviewTagControl.xaml.h">
|
||||||
|
<DependentUpon>Controls\PreviewTagControl.xaml</DependentUpon>
|
||||||
|
</ClInclude>
|
||||||
<ClInclude Include="Controls\RadixButton.h" />
|
<ClInclude Include="Controls\RadixButton.h" />
|
||||||
<ClInclude Include="Controls\SupplementaryItemsControl.h" />
|
<ClInclude Include="Controls\SupplementaryItemsControl.h" />
|
||||||
<ClInclude Include="Converters\BooleanNegationConverter.h" />
|
<ClInclude Include="Converters\BooleanNegationConverter.h" />
|
||||||
@ -346,6 +349,9 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
<Page Include="AboutFlyout.xaml" />
|
<Page Include="AboutFlyout.xaml" />
|
||||||
|
<Page Include="Controls\PreviewTagControl.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Include="EquationStylePanelControl.xaml">
|
<Page Include="EquationStylePanelControl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
@ -410,6 +416,9 @@
|
|||||||
<ClCompile Include="Controls\CalculatorButton.cpp" />
|
<ClCompile Include="Controls\CalculatorButton.cpp" />
|
||||||
<ClCompile Include="Controls\FlipButtons.cpp" />
|
<ClCompile Include="Controls\FlipButtons.cpp" />
|
||||||
<ClCompile Include="Controls\OverflowTextBlock.cpp" />
|
<ClCompile Include="Controls\OverflowTextBlock.cpp" />
|
||||||
|
<ClCompile Include="Controls\PreviewTagControl.xaml.cpp">
|
||||||
|
<DependentUpon>Controls\PreviewTagControl.xaml</DependentUpon>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="Controls\RadixButton.cpp" />
|
<ClCompile Include="Controls\RadixButton.cpp" />
|
||||||
<ClCompile Include="Controls\SupplementaryItemsControl.cpp" />
|
<ClCompile Include="Controls\SupplementaryItemsControl.cpp" />
|
||||||
<ClCompile Include="Converters\BooleanNegationConverter.cpp" />
|
<ClCompile Include="Converters\BooleanNegationConverter.cpp" />
|
||||||
|
57
src/Calculator/Controls/PreviewTagControl.xaml
Normal file
57
src/Calculator/Controls/PreviewTagControl.xaml
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<UserControl x:Class="CalculatorApp.Controls.PreviewTagControl"
|
||||||
|
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
d:DesignHeight="300"
|
||||||
|
d:DesignWidth="400"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.ThemeDictionaries>
|
||||||
|
<ResourceDictionary x:Key="Default">
|
||||||
|
<Style x:Key="PreviewTagRectStyle" TargetType="Rectangle">
|
||||||
|
<Setter Property="Opacity" Value="0.86"/>
|
||||||
|
<Setter Property="Fill" Value="{ThemeResource SystemAccentColor}"/>
|
||||||
|
</Style>
|
||||||
|
<Style x:Key="PreviewTagTextStyle" TargetType="TextBlock">
|
||||||
|
<Setter Property="Foreground" Value="White"/>
|
||||||
|
<Setter Property="FontSize" Value="11"/>
|
||||||
|
<Setter Property="Margin" Value="4,0,4,1"/>
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
|
<ResourceDictionary x:Key="Light">
|
||||||
|
<Style x:Key="PreviewTagRectStyle" TargetType="Rectangle">
|
||||||
|
<Setter Property="Opacity" Value="0.86"/>
|
||||||
|
<Setter Property="Fill" Value="{ThemeResource SystemAccentColor}"/>
|
||||||
|
</Style>
|
||||||
|
<Style x:Key="PreviewTagTextStyle" TargetType="TextBlock">
|
||||||
|
<Setter Property="Foreground" Value="White"/>
|
||||||
|
<Setter Property="FontSize" Value="11"/>
|
||||||
|
<Setter Property="Margin" Value="4,0,4,1"/>
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
|
<ResourceDictionary x:Key="HighContrast">
|
||||||
|
<Style x:Key="PreviewTagRectStyle" TargetType="Rectangle">
|
||||||
|
<Setter Property="Fill" Value="{ThemeResource SystemColorWindowBrush}"/>
|
||||||
|
<Setter Property="Stroke" Value="{ThemeResource SystemColorWindowTextBrush}"/>
|
||||||
|
<Setter Property="StrokeThickness" Value="1"/>
|
||||||
|
</Style>
|
||||||
|
<Style x:Key="PreviewTagTextStyle" TargetType="TextBlock">
|
||||||
|
<Setter Property="Foreground" Value="{ThemeResource SystemColorWindowTextBrush}"/>
|
||||||
|
<Setter Property="FontSize" Value="14"/>
|
||||||
|
<Setter Property="Margin" Value="6,2,6,3"/>
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ResourceDictionary.ThemeDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</UserControl.Resources>
|
||||||
|
<Grid>
|
||||||
|
<Rectangle Style="{ThemeResource PreviewTagRectStyle}"
|
||||||
|
RadiusX="2"
|
||||||
|
RadiusY="2"/>
|
||||||
|
<TextBlock Style="{ThemeResource PreviewTagTextStyle}"
|
||||||
|
FontWeight="SemiBold"
|
||||||
|
Text="Preview"/>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
23
src/Calculator/Controls/PreviewTagControl.xaml.cpp
Normal file
23
src/Calculator/Controls/PreviewTagControl.xaml.cpp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
|
#include "pch.h"
|
||||||
|
#include "PreviewTagControl.xaml.h"
|
||||||
|
|
||||||
|
using namespace CalculatorApp;
|
||||||
|
using namespace CalculatorApp::Controls;
|
||||||
|
using namespace Platform;
|
||||||
|
using namespace Windows::Foundation;
|
||||||
|
using namespace Windows::Foundation::Collections;
|
||||||
|
using namespace Windows::UI::Xaml;
|
||||||
|
using namespace Windows::UI::Xaml::Controls;
|
||||||
|
using namespace Windows::UI::Xaml::Controls::Primitives;
|
||||||
|
using namespace Windows::UI::Xaml::Data;
|
||||||
|
using namespace Windows::UI::Xaml::Input;
|
||||||
|
using namespace Windows::UI::Xaml::Media;
|
||||||
|
using namespace Windows::UI::Xaml::Navigation;
|
||||||
|
|
||||||
|
PreviewTagControl::PreviewTagControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
16
src/Calculator/Controls/PreviewTagControl.xaml.h
Normal file
16
src/Calculator/Controls/PreviewTagControl.xaml.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Controls\PreviewTagControl.g.h"
|
||||||
|
|
||||||
|
namespace CalculatorApp::Controls
|
||||||
|
{
|
||||||
|
[Windows::Foundation::Metadata::WebHostHidden]
|
||||||
|
public ref class PreviewTagControl sealed
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PreviewTagControl();
|
||||||
|
};
|
||||||
|
}
|
@ -426,8 +426,7 @@
|
|||||||
MinWidth="40"
|
MinWidth="40"
|
||||||
Style="{ThemeResource ThemedGraphButtonStyle}"
|
Style="{ThemeResource ThemedGraphButtonStyle}"
|
||||||
contract7Present:CornerRadius="{ThemeResource RightButtonCornerRadius}"
|
contract7Present:CornerRadius="{ThemeResource RightButtonCornerRadius}"
|
||||||
Click="GraphSettingsButton_Click"
|
Click="GraphSettingsButton_Click">
|
||||||
RequestedTheme="Light">
|
|
||||||
<FontIcon FontFamily="{StaticResource CalculatorFontFamily}"
|
<FontIcon FontFamily="{StaticResource CalculatorFontFamily}"
|
||||||
FontSize="18"
|
FontSize="18"
|
||||||
Glyph=""/>
|
Glyph=""/>
|
||||||
|
@ -33,6 +33,13 @@
|
|||||||
<Setter Property="KeyTipPlacementMode" Value="Right"/>
|
<Setter Property="KeyTipPlacementMode" Value="Right"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<DataTemplate x:Key="NavMenuItemPreviewDataTemplate" x:DataType="x:String">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock VerticalAlignment="Center" Text="{x:Bind}"/>
|
||||||
|
<controls:PreviewTagControl Margin="6,0,0,0" VerticalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
<converters:BooleanToVisibilityNegationConverter x:Key="BooleanToVisibilityNegationConverter"/>
|
<converters:BooleanToVisibilityNegationConverter x:Key="BooleanToVisibilityNegationConverter"/>
|
||||||
<converters:BooleanNegationConverter x:Key="BooleanNegationConverter"/>
|
<converters:BooleanNegationConverter x:Key="BooleanNegationConverter"/>
|
||||||
</Page.Resources>
|
</Page.Resources>
|
||||||
@ -157,23 +164,28 @@
|
|||||||
</muxc:NavigationViewList>
|
</muxc:NavigationViewList>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</muxc:NavigationView.PaneFooter>
|
</muxc:NavigationView.PaneFooter>
|
||||||
<Grid>
|
<Grid Height="{StaticResource HamburgerHeight}" VerticalAlignment="Top">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel Margin="52,0,0,0" Orientation="Horizontal">
|
||||||
<TextBlock x:Name="Header"
|
<TextBlock x:Name="Header"
|
||||||
Grid.Column="0"
|
Margin="0,-3,0,0"
|
||||||
Margin="52,6,12,0"
|
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Center"
|
||||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||||
Text="{x:Bind Model.CategoryName, Mode=OneWay}"
|
Text="{x:Bind Model.CategoryName, Mode=OneWay}"
|
||||||
Visibility="{x:Bind Model.IsAlwaysOnTop, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}"/>
|
Visibility="{x:Bind Model.IsAlwaysOnTop, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}"/>
|
||||||
|
<controls:PreviewTagControl Margin="6,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Visibility="{x:Bind Model.IsModePreview, Mode=OneWay}"/>
|
||||||
|
</StackPanel>
|
||||||
<Button x:Name="NormalAlwaysOnTopButton"
|
<Button x:Name="NormalAlwaysOnTopButton"
|
||||||
x:Uid="EnterAlwaysOnTopButton"
|
x:Uid="EnterAlwaysOnTopButton"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
VerticalAlignment="Top"
|
Margin="10,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
HorizontalContentAlignment="Center"
|
HorizontalContentAlignment="Center"
|
||||||
Style="{StaticResource SquareIconButtonStyle}"
|
Style="{StaticResource SquareIconButtonStyle}"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
|
@ -498,7 +498,17 @@ MUXC::NavigationViewItem ^ MainPage::CreateNavViewItemFromCategory(NavCategory ^
|
|||||||
icon->Glyph = category->Glyph;
|
icon->Glyph = category->Glyph;
|
||||||
item->Icon = icon;
|
item->Icon = icon;
|
||||||
|
|
||||||
|
if (category->IsPreview)
|
||||||
|
{
|
||||||
|
auto contentPresenter = ref new ContentPresenter();
|
||||||
|
contentPresenter->Content = category->Name;
|
||||||
|
contentPresenter->ContentTemplate = static_cast<DataTemplate ^>(Resources->Lookup(L"NavMenuItemPreviewDataTemplate"));
|
||||||
|
item->Content = contentPresenter;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
item->Content = category->Name;
|
item->Content = category->Name;
|
||||||
|
}
|
||||||
item->AccessKey = category->AccessKey;
|
item->AccessKey = category->AccessKey;
|
||||||
item->IsEnabled = category->IsEnabled;
|
item->IsEnabled = category->IsEnabled;
|
||||||
item->Style = static_cast<Windows::UI::Xaml::Style ^>(Resources->Lookup(L"NavViewItemStyle"));
|
item->Style = static_cast<Windows::UI::Xaml::Style ^>(Resources->Lookup(L"NavViewItemStyle"));
|
||||||
|
Loading…
Reference in New Issue
Block a user