-
Notifications
You must be signed in to change notification settings - Fork 705
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create clean branch for CR. * Header should be IInspectable, not String. * CR fixes * Responding to CR feedback. * Updates for CR, resource issues, and RS4 failures * Themeresource test fix * A much BETTER fix for the themeresource test issue. * Last CR feedback items
- Loading branch information
Showing
35 changed files
with
2,113 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
// 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 | ||
#include "pch.h" | ||
#include "common.h" | ||
#include "TabView.h" | ||
|
||
CppWinRTActivatableClassWithDPFactory(TabView) | ||
|
||
GlobalDependencyProperty TabViewProperties::s_CanCloseTabsProperty{ nullptr }; | ||
GlobalDependencyProperty TabViewProperties::s_LeftCustomContentProperty{ nullptr }; | ||
GlobalDependencyProperty TabViewProperties::s_LeftCustomContentTemplateProperty{ nullptr }; | ||
GlobalDependencyProperty TabViewProperties::s_RightCustomContentProperty{ nullptr }; | ||
GlobalDependencyProperty TabViewProperties::s_RightCustomContentTemplateProperty{ nullptr }; | ||
GlobalDependencyProperty TabViewProperties::s_TabWidthModeProperty{ nullptr }; | ||
|
||
TabViewProperties::TabViewProperties() | ||
: m_tabClosingEventSource{static_cast<TabView*>(this)} | ||
{ | ||
EnsureProperties(); | ||
} | ||
|
||
void TabViewProperties::EnsureProperties() | ||
{ | ||
if (!s_CanCloseTabsProperty) | ||
{ | ||
s_CanCloseTabsProperty = | ||
InitializeDependencyProperty( | ||
L"CanCloseTabs", | ||
winrt::name_of<bool>(), | ||
winrt::name_of<winrt::TabView>(), | ||
false /* isAttached */, | ||
ValueHelper<bool>::BoxValueIfNecessary(true), | ||
nullptr); | ||
} | ||
if (!s_LeftCustomContentProperty) | ||
{ | ||
s_LeftCustomContentProperty = | ||
InitializeDependencyProperty( | ||
L"LeftCustomContent", | ||
winrt::name_of<winrt::IInspectable>(), | ||
winrt::name_of<winrt::TabView>(), | ||
false /* isAttached */, | ||
ValueHelper<winrt::IInspectable>::BoxedDefaultValue(), | ||
nullptr); | ||
} | ||
if (!s_LeftCustomContentTemplateProperty) | ||
{ | ||
s_LeftCustomContentTemplateProperty = | ||
InitializeDependencyProperty( | ||
L"LeftCustomContentTemplate", | ||
winrt::name_of<winrt::DataTemplate>(), | ||
winrt::name_of<winrt::TabView>(), | ||
false /* isAttached */, | ||
ValueHelper<winrt::DataTemplate>::BoxedDefaultValue(), | ||
nullptr); | ||
} | ||
if (!s_RightCustomContentProperty) | ||
{ | ||
s_RightCustomContentProperty = | ||
InitializeDependencyProperty( | ||
L"RightCustomContent", | ||
winrt::name_of<winrt::IInspectable>(), | ||
winrt::name_of<winrt::TabView>(), | ||
false /* isAttached */, | ||
ValueHelper<winrt::IInspectable>::BoxedDefaultValue(), | ||
nullptr); | ||
} | ||
if (!s_RightCustomContentTemplateProperty) | ||
{ | ||
s_RightCustomContentTemplateProperty = | ||
InitializeDependencyProperty( | ||
L"RightCustomContentTemplate", | ||
winrt::name_of<winrt::DataTemplate>(), | ||
winrt::name_of<winrt::TabView>(), | ||
false /* isAttached */, | ||
ValueHelper<winrt::DataTemplate>::BoxedDefaultValue(), | ||
nullptr); | ||
} | ||
if (!s_TabWidthModeProperty) | ||
{ | ||
s_TabWidthModeProperty = | ||
InitializeDependencyProperty( | ||
L"TabWidthMode", | ||
winrt::name_of<winrt::TabViewWidthMode>(), | ||
winrt::name_of<winrt::TabView>(), | ||
false /* isAttached */, | ||
ValueHelper<winrt::TabViewWidthMode>::BoxValueIfNecessary(winrt::TabViewWidthMode::SizeToContent), | ||
winrt::PropertyChangedCallback(&OnTabWidthModePropertyChanged)); | ||
} | ||
} | ||
|
||
void TabViewProperties::ClearProperties() | ||
{ | ||
s_CanCloseTabsProperty = nullptr; | ||
s_LeftCustomContentProperty = nullptr; | ||
s_LeftCustomContentTemplateProperty = nullptr; | ||
s_RightCustomContentProperty = nullptr; | ||
s_RightCustomContentTemplateProperty = nullptr; | ||
s_TabWidthModeProperty = nullptr; | ||
} | ||
|
||
void TabViewProperties::OnTabWidthModePropertyChanged( | ||
winrt::DependencyObject const& sender, | ||
winrt::DependencyPropertyChangedEventArgs const& args) | ||
{ | ||
auto owner = sender.as<winrt::TabView>(); | ||
winrt::get_self<TabView>(owner)->OnTabWidthModePropertyChanged(args); | ||
} | ||
|
||
void TabViewProperties::CanCloseTabs(bool value) | ||
{ | ||
static_cast<TabView*>(this)->SetValue(s_CanCloseTabsProperty, ValueHelper<bool>::BoxValueIfNecessary(value)); | ||
} | ||
|
||
bool TabViewProperties::CanCloseTabs() | ||
{ | ||
return ValueHelper<bool>::CastOrUnbox(static_cast<TabView*>(this)->GetValue(s_CanCloseTabsProperty)); | ||
} | ||
|
||
void TabViewProperties::LeftCustomContent(winrt::IInspectable const& value) | ||
{ | ||
static_cast<TabView*>(this)->SetValue(s_LeftCustomContentProperty, ValueHelper<winrt::IInspectable>::BoxValueIfNecessary(value)); | ||
} | ||
|
||
winrt::IInspectable TabViewProperties::LeftCustomContent() | ||
{ | ||
return ValueHelper<winrt::IInspectable>::CastOrUnbox(static_cast<TabView*>(this)->GetValue(s_LeftCustomContentProperty)); | ||
} | ||
|
||
void TabViewProperties::LeftCustomContentTemplate(winrt::DataTemplate const& value) | ||
{ | ||
static_cast<TabView*>(this)->SetValue(s_LeftCustomContentTemplateProperty, ValueHelper<winrt::DataTemplate>::BoxValueIfNecessary(value)); | ||
} | ||
|
||
winrt::DataTemplate TabViewProperties::LeftCustomContentTemplate() | ||
{ | ||
return ValueHelper<winrt::DataTemplate>::CastOrUnbox(static_cast<TabView*>(this)->GetValue(s_LeftCustomContentTemplateProperty)); | ||
} | ||
|
||
void TabViewProperties::RightCustomContent(winrt::IInspectable const& value) | ||
{ | ||
static_cast<TabView*>(this)->SetValue(s_RightCustomContentProperty, ValueHelper<winrt::IInspectable>::BoxValueIfNecessary(value)); | ||
} | ||
|
||
winrt::IInspectable TabViewProperties::RightCustomContent() | ||
{ | ||
return ValueHelper<winrt::IInspectable>::CastOrUnbox(static_cast<TabView*>(this)->GetValue(s_RightCustomContentProperty)); | ||
} | ||
|
||
void TabViewProperties::RightCustomContentTemplate(winrt::DataTemplate const& value) | ||
{ | ||
static_cast<TabView*>(this)->SetValue(s_RightCustomContentTemplateProperty, ValueHelper<winrt::DataTemplate>::BoxValueIfNecessary(value)); | ||
} | ||
|
||
winrt::DataTemplate TabViewProperties::RightCustomContentTemplate() | ||
{ | ||
return ValueHelper<winrt::DataTemplate>::CastOrUnbox(static_cast<TabView*>(this)->GetValue(s_RightCustomContentTemplateProperty)); | ||
} | ||
|
||
void TabViewProperties::TabWidthMode(winrt::TabViewWidthMode const& value) | ||
{ | ||
static_cast<TabView*>(this)->SetValue(s_TabWidthModeProperty, ValueHelper<winrt::TabViewWidthMode>::BoxValueIfNecessary(value)); | ||
} | ||
|
||
winrt::TabViewWidthMode TabViewProperties::TabWidthMode() | ||
{ | ||
return ValueHelper<winrt::TabViewWidthMode>::CastOrUnbox(static_cast<TabView*>(this)->GetValue(s_TabWidthModeProperty)); | ||
} | ||
|
||
winrt::event_token TabViewProperties::TabClosing(winrt::TypedEventHandler<winrt::TabView, winrt::TabViewTabClosingEventArgs> const& value) | ||
{ | ||
return m_tabClosingEventSource.add(value); | ||
} | ||
|
||
void TabViewProperties::TabClosing(winrt::event_token const& token) | ||
{ | ||
m_tabClosingEventSource.remove(token); | ||
} |
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,55 @@ | ||
// 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 | ||
#pragma once | ||
|
||
class TabViewProperties | ||
{ | ||
public: | ||
TabViewProperties(); | ||
|
||
void CanCloseTabs(bool value); | ||
bool CanCloseTabs(); | ||
|
||
void LeftCustomContent(winrt::IInspectable const& value); | ||
winrt::IInspectable LeftCustomContent(); | ||
|
||
void LeftCustomContentTemplate(winrt::DataTemplate const& value); | ||
winrt::DataTemplate LeftCustomContentTemplate(); | ||
|
||
void RightCustomContent(winrt::IInspectable const& value); | ||
winrt::IInspectable RightCustomContent(); | ||
|
||
void RightCustomContentTemplate(winrt::DataTemplate const& value); | ||
winrt::DataTemplate RightCustomContentTemplate(); | ||
|
||
void TabWidthMode(winrt::TabViewWidthMode const& value); | ||
winrt::TabViewWidthMode TabWidthMode(); | ||
|
||
static winrt::DependencyProperty CanCloseTabsProperty() { return s_CanCloseTabsProperty; } | ||
static winrt::DependencyProperty LeftCustomContentProperty() { return s_LeftCustomContentProperty; } | ||
static winrt::DependencyProperty LeftCustomContentTemplateProperty() { return s_LeftCustomContentTemplateProperty; } | ||
static winrt::DependencyProperty RightCustomContentProperty() { return s_RightCustomContentProperty; } | ||
static winrt::DependencyProperty RightCustomContentTemplateProperty() { return s_RightCustomContentTemplateProperty; } | ||
static winrt::DependencyProperty TabWidthModeProperty() { return s_TabWidthModeProperty; } | ||
|
||
static GlobalDependencyProperty s_CanCloseTabsProperty; | ||
static GlobalDependencyProperty s_LeftCustomContentProperty; | ||
static GlobalDependencyProperty s_LeftCustomContentTemplateProperty; | ||
static GlobalDependencyProperty s_RightCustomContentProperty; | ||
static GlobalDependencyProperty s_RightCustomContentTemplateProperty; | ||
static GlobalDependencyProperty s_TabWidthModeProperty; | ||
|
||
winrt::event_token TabClosing(winrt::TypedEventHandler<winrt::TabView, winrt::TabViewTabClosingEventArgs> const& value); | ||
void TabClosing(winrt::event_token const& token); | ||
|
||
event_source<winrt::TypedEventHandler<winrt::TabView, winrt::TabViewTabClosingEventArgs>> m_tabClosingEventSource; | ||
|
||
static void EnsureProperties(); | ||
static void ClearProperties(); | ||
|
||
static void OnTabWidthModePropertyChanged( | ||
winrt::DependencyObject const& sender, | ||
winrt::DependencyPropertyChangedEventArgs const& args); | ||
}; |
Oops, something went wrong.