Skip to content

Commit

Permalink
Update TeachingTip APIs per review (#451)
Browse files Browse the repository at this point in the history
* Change TargetOffset to PlacementMargin

* Change Pointer to Tail, PointerMode to TailVisibility, TeachingTIpPointerMode{auto,on,off} to TeachingTipTailVisibility{auto,Visible,Collapsed}
  • Loading branch information
StephenLPeters authored Mar 19, 2019
1 parent 56964b6 commit 790fdc4
Show file tree
Hide file tree
Showing 12 changed files with 491 additions and 491 deletions.
74 changes: 37 additions & 37 deletions dev/Generated/TeachingTip.properties.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen
Expand All @@ -21,11 +21,11 @@ GlobalDependencyProperty TeachingTipProperties::s_HeroContentPlacementProperty{
GlobalDependencyProperty TeachingTipProperties::s_IconSourceProperty{ nullptr };
GlobalDependencyProperty TeachingTipProperties::s_IsLightDismissEnabledProperty{ nullptr };
GlobalDependencyProperty TeachingTipProperties::s_IsOpenProperty{ nullptr };
GlobalDependencyProperty TeachingTipProperties::s_PointerModeProperty{ nullptr };
GlobalDependencyProperty TeachingTipProperties::s_PlacementMarginProperty{ nullptr };
GlobalDependencyProperty TeachingTipProperties::s_PreferredPlacementProperty{ nullptr };
GlobalDependencyProperty TeachingTipProperties::s_SubtitleProperty{ nullptr };
GlobalDependencyProperty TeachingTipProperties::s_TailVisibilityProperty{ nullptr };
GlobalDependencyProperty TeachingTipProperties::s_TargetProperty{ nullptr };
GlobalDependencyProperty TeachingTipProperties::s_TargetOffsetProperty{ nullptr };
GlobalDependencyProperty TeachingTipProperties::s_TemplateSettingsProperty{ nullptr };
GlobalDependencyProperty TeachingTipProperties::s_TitleProperty{ nullptr };

Expand Down Expand Up @@ -183,16 +183,16 @@ void TeachingTipProperties::EnsureProperties()
ValueHelper<bool>::BoxValueIfNecessary(false),
winrt::PropertyChangedCallback(&OnIsOpenPropertyChanged));
}
if (!s_PointerModeProperty)
if (!s_PlacementMarginProperty)
{
s_PointerModeProperty =
s_PlacementMarginProperty =
InitializeDependencyProperty(
L"PointerMode",
winrt::name_of<winrt::TeachingTipPointerMode>(),
L"PlacementMargin",
winrt::name_of<winrt::Thickness>(),
winrt::name_of<winrt::TeachingTip>(),
false /* isAttached */,
ValueHelper<winrt::TeachingTipPointerMode>::BoxValueIfNecessary(winrt::TeachingTipPointerMode::Auto),
winrt::PropertyChangedCallback(&OnPointerModePropertyChanged));
ValueHelper<winrt::Thickness>::BoxedDefaultValue(),
winrt::PropertyChangedCallback(&OnPlacementMarginPropertyChanged));
}
if (!s_PreferredPlacementProperty)
{
Expand All @@ -216,6 +216,17 @@ void TeachingTipProperties::EnsureProperties()
ValueHelper<winrt::hstring>::BoxedDefaultValue(),
winrt::PropertyChangedCallback(&OnSubtitlePropertyChanged));
}
if (!s_TailVisibilityProperty)
{
s_TailVisibilityProperty =
InitializeDependencyProperty(
L"TailVisibility",
winrt::name_of<winrt::TeachingTipTailVisibility>(),
winrt::name_of<winrt::TeachingTip>(),
false /* isAttached */,
ValueHelper<winrt::TeachingTipTailVisibility>::BoxValueIfNecessary(winrt::TeachingTipTailVisibility::Auto),
winrt::PropertyChangedCallback(&OnTailVisibilityPropertyChanged));
}
if (!s_TargetProperty)
{
s_TargetProperty =
Expand All @@ -227,17 +238,6 @@ void TeachingTipProperties::EnsureProperties()
ValueHelper<winrt::FrameworkElement>::BoxedDefaultValue(),
winrt::PropertyChangedCallback(&OnTargetPropertyChanged));
}
if (!s_TargetOffsetProperty)
{
s_TargetOffsetProperty =
InitializeDependencyProperty(
L"TargetOffset",
winrt::name_of<winrt::Thickness>(),
winrt::name_of<winrt::TeachingTip>(),
false /* isAttached */,
ValueHelper<winrt::Thickness>::BoxedDefaultValue(),
winrt::PropertyChangedCallback(&OnTargetOffsetPropertyChanged));
}
if (!s_TemplateSettingsProperty)
{
s_TemplateSettingsProperty =
Expand Down Expand Up @@ -277,11 +277,11 @@ void TeachingTipProperties::ClearProperties()
s_IconSourceProperty = nullptr;
s_IsLightDismissEnabledProperty = nullptr;
s_IsOpenProperty = nullptr;
s_PointerModeProperty = nullptr;
s_PlacementMarginProperty = nullptr;
s_PreferredPlacementProperty = nullptr;
s_SubtitleProperty = nullptr;
s_TailVisibilityProperty = nullptr;
s_TargetProperty = nullptr;
s_TargetOffsetProperty = nullptr;
s_TemplateSettingsProperty = nullptr;
s_TitleProperty = nullptr;
}
Expand Down Expand Up @@ -390,7 +390,7 @@ void TeachingTipProperties::OnIsOpenPropertyChanged(
winrt::get_self<TeachingTip>(owner)->OnPropertyChanged(args);
}

void TeachingTipProperties::OnPointerModePropertyChanged(
void TeachingTipProperties::OnPlacementMarginPropertyChanged(
winrt::DependencyObject const& sender,
winrt::DependencyPropertyChangedEventArgs const& args)
{
Expand All @@ -414,15 +414,15 @@ void TeachingTipProperties::OnSubtitlePropertyChanged(
winrt::get_self<TeachingTip>(owner)->OnPropertyChanged(args);
}

void TeachingTipProperties::OnTargetPropertyChanged(
void TeachingTipProperties::OnTailVisibilityPropertyChanged(
winrt::DependencyObject const& sender,
winrt::DependencyPropertyChangedEventArgs const& args)
{
auto owner = sender.as<winrt::TeachingTip>();
winrt::get_self<TeachingTip>(owner)->OnPropertyChanged(args);
}

void TeachingTipProperties::OnTargetOffsetPropertyChanged(
void TeachingTipProperties::OnTargetPropertyChanged(
winrt::DependencyObject const& sender,
winrt::DependencyPropertyChangedEventArgs const& args)
{
Expand Down Expand Up @@ -576,14 +576,14 @@ bool TeachingTipProperties::IsOpen()
return ValueHelper<bool>::CastOrUnbox(static_cast<TeachingTip*>(this)->GetValue(s_IsOpenProperty));
}

void TeachingTipProperties::PointerMode(winrt::TeachingTipPointerMode const& value)
void TeachingTipProperties::PlacementMargin(winrt::Thickness const& value)
{
static_cast<TeachingTip*>(this)->SetValue(s_PointerModeProperty, ValueHelper<winrt::TeachingTipPointerMode>::BoxValueIfNecessary(value));
static_cast<TeachingTip*>(this)->SetValue(s_PlacementMarginProperty, ValueHelper<winrt::Thickness>::BoxValueIfNecessary(value));
}

winrt::TeachingTipPointerMode TeachingTipProperties::PointerMode()
winrt::Thickness TeachingTipProperties::PlacementMargin()
{
return ValueHelper<winrt::TeachingTipPointerMode>::CastOrUnbox(static_cast<TeachingTip*>(this)->GetValue(s_PointerModeProperty));
return ValueHelper<winrt::Thickness>::CastOrUnbox(static_cast<TeachingTip*>(this)->GetValue(s_PlacementMarginProperty));
}

void TeachingTipProperties::PreferredPlacement(winrt::TeachingTipPlacementMode const& value)
Expand All @@ -606,24 +606,24 @@ winrt::hstring TeachingTipProperties::Subtitle()
return ValueHelper<winrt::hstring>::CastOrUnbox(static_cast<TeachingTip*>(this)->GetValue(s_SubtitleProperty));
}

void TeachingTipProperties::Target(winrt::FrameworkElement const& value)
void TeachingTipProperties::TailVisibility(winrt::TeachingTipTailVisibility const& value)
{
static_cast<TeachingTip*>(this)->SetValue(s_TargetProperty, ValueHelper<winrt::FrameworkElement>::BoxValueIfNecessary(value));
static_cast<TeachingTip*>(this)->SetValue(s_TailVisibilityProperty, ValueHelper<winrt::TeachingTipTailVisibility>::BoxValueIfNecessary(value));
}

winrt::FrameworkElement TeachingTipProperties::Target()
winrt::TeachingTipTailVisibility TeachingTipProperties::TailVisibility()
{
return ValueHelper<winrt::FrameworkElement>::CastOrUnbox(static_cast<TeachingTip*>(this)->GetValue(s_TargetProperty));
return ValueHelper<winrt::TeachingTipTailVisibility>::CastOrUnbox(static_cast<TeachingTip*>(this)->GetValue(s_TailVisibilityProperty));
}

void TeachingTipProperties::TargetOffset(winrt::Thickness const& value)
void TeachingTipProperties::Target(winrt::FrameworkElement const& value)
{
static_cast<TeachingTip*>(this)->SetValue(s_TargetOffsetProperty, ValueHelper<winrt::Thickness>::BoxValueIfNecessary(value));
static_cast<TeachingTip*>(this)->SetValue(s_TargetProperty, ValueHelper<winrt::FrameworkElement>::BoxValueIfNecessary(value));
}

winrt::Thickness TeachingTipProperties::TargetOffset()
winrt::FrameworkElement TeachingTipProperties::Target()
{
return ValueHelper<winrt::Thickness>::CastOrUnbox(static_cast<TeachingTip*>(this)->GetValue(s_TargetOffsetProperty));
return ValueHelper<winrt::FrameworkElement>::CastOrUnbox(static_cast<TeachingTip*>(this)->GetValue(s_TargetProperty));
}

void TeachingTipProperties::TemplateSettings(winrt::TeachingTipTemplateSettings const& value)
Expand Down
24 changes: 12 additions & 12 deletions dev/Generated/TeachingTip.properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ class TeachingTipProperties
void IsOpen(bool value);
bool IsOpen();

void PointerMode(winrt::TeachingTipPointerMode const& value);
winrt::TeachingTipPointerMode PointerMode();
void PlacementMargin(winrt::Thickness const& value);
winrt::Thickness PlacementMargin();

void PreferredPlacement(winrt::TeachingTipPlacementMode const& value);
winrt::TeachingTipPlacementMode PreferredPlacement();

void Subtitle(winrt::hstring const& value);
winrt::hstring Subtitle();

void TailVisibility(winrt::TeachingTipTailVisibility const& value);
winrt::TeachingTipTailVisibility TailVisibility();

void Target(winrt::FrameworkElement const& value);
winrt::FrameworkElement Target();

void TargetOffset(winrt::Thickness const& value);
winrt::Thickness TargetOffset();

void TemplateSettings(winrt::TeachingTipTemplateSettings const& value);
winrt::TeachingTipTemplateSettings TemplateSettings();

Expand All @@ -82,11 +82,11 @@ class TeachingTipProperties
static winrt::DependencyProperty IconSourceProperty() { return s_IconSourceProperty; }
static winrt::DependencyProperty IsLightDismissEnabledProperty() { return s_IsLightDismissEnabledProperty; }
static winrt::DependencyProperty IsOpenProperty() { return s_IsOpenProperty; }
static winrt::DependencyProperty PointerModeProperty() { return s_PointerModeProperty; }
static winrt::DependencyProperty PlacementMarginProperty() { return s_PlacementMarginProperty; }
static winrt::DependencyProperty PreferredPlacementProperty() { return s_PreferredPlacementProperty; }
static winrt::DependencyProperty SubtitleProperty() { return s_SubtitleProperty; }
static winrt::DependencyProperty TailVisibilityProperty() { return s_TailVisibilityProperty; }
static winrt::DependencyProperty TargetProperty() { return s_TargetProperty; }
static winrt::DependencyProperty TargetOffsetProperty() { return s_TargetOffsetProperty; }
static winrt::DependencyProperty TemplateSettingsProperty() { return s_TemplateSettingsProperty; }
static winrt::DependencyProperty TitleProperty() { return s_TitleProperty; }

Expand All @@ -103,11 +103,11 @@ class TeachingTipProperties
static GlobalDependencyProperty s_IconSourceProperty;
static GlobalDependencyProperty s_IsLightDismissEnabledProperty;
static GlobalDependencyProperty s_IsOpenProperty;
static GlobalDependencyProperty s_PointerModeProperty;
static GlobalDependencyProperty s_PlacementMarginProperty;
static GlobalDependencyProperty s_PreferredPlacementProperty;
static GlobalDependencyProperty s_SubtitleProperty;
static GlobalDependencyProperty s_TailVisibilityProperty;
static GlobalDependencyProperty s_TargetProperty;
static GlobalDependencyProperty s_TargetOffsetProperty;
static GlobalDependencyProperty s_TemplateSettingsProperty;
static GlobalDependencyProperty s_TitleProperty;

Expand Down Expand Up @@ -180,7 +180,7 @@ class TeachingTipProperties
winrt::DependencyObject const& sender,
winrt::DependencyPropertyChangedEventArgs const& args);

static void OnPointerModePropertyChanged(
static void OnPlacementMarginPropertyChanged(
winrt::DependencyObject const& sender,
winrt::DependencyPropertyChangedEventArgs const& args);

Expand All @@ -192,11 +192,11 @@ class TeachingTipProperties
winrt::DependencyObject const& sender,
winrt::DependencyPropertyChangedEventArgs const& args);

static void OnTargetPropertyChanged(
static void OnTailVisibilityPropertyChanged(
winrt::DependencyObject const& sender,
winrt::DependencyPropertyChangedEventArgs const& args);

static void OnTargetOffsetPropertyChanged(
static void OnTargetPropertyChanged(
winrt::DependencyObject const& sender,
winrt::DependencyPropertyChangedEventArgs const& args);

Expand Down
Loading

0 comments on commit 790fdc4

Please sign in to comment.