Skip to content

Commit

Permalink
Move NavigationView to Repeater (#1683)
Browse files Browse the repository at this point in the history
* replaced listview with repeater

* removed NavigationViewList from DisableAnimationsStyles

* fixed release build error

* addressed some comments

* addressed some more comments

* items repeater update

* addressed more comments

* removed state machine

* addressed more comments

* fixed settings

* fixed SelectionChanged raised due to initialization order

* fixed merge

* added datacontext use case page and test

* addressed comments

* addressed more comments

* re-added downlevel testpages

* updated focus navigation behavior

- update focus behavior
- fix repeater bug

* fixed pane content width bug

* updated/fixed tests

* updated masters

* fixed/updated tests

* addressed comments

* reverted downlevel flag behavior

reverted ShouldPreserveNavigationViewRS4Behavior and ShouldPreserveNavigationViewRS3Behavior to old behavior. Old behavior was inccorectly determining OS version, however updating to correct behavior breaks tests, so reverting to old behavior for now

* added repeater API test, fixed pre-rs5 header visibility test

* updated masters

* moved preview API call, reset masters

* address comment

* updated visual verification test
  • Loading branch information
ojhad authored Jan 13, 2020
1 parent 1f48f11 commit f3862ec
Show file tree
Hide file tree
Showing 69 changed files with 10,242 additions and 17,776 deletions.
16 changes: 16 additions & 0 deletions dev/Generated/NavigationViewAutomationPeer.properties.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// 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 "NavigationViewAutomationPeer.h"

namespace winrt::Microsoft::UI::Xaml::Automation::Peers
{
CppWinRTActivatableClassWithBasicFactory(NavigationViewAutomationPeer)
}

#include "NavigationViewAutomationPeer.g.cpp"


31 changes: 31 additions & 0 deletions dev/Generated/StackLayout.properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace winrt::Microsoft::UI::Xaml::Controls

#include "StackLayout.g.cpp"

GlobalDependencyProperty StackLayoutProperties::s_DisableVirtualizationProperty{ nullptr };
GlobalDependencyProperty StackLayoutProperties::s_OrientationProperty{ nullptr };
GlobalDependencyProperty StackLayoutProperties::s_SpacingProperty{ nullptr };

Expand All @@ -23,6 +24,17 @@ StackLayoutProperties::StackLayoutProperties()

void StackLayoutProperties::EnsureProperties()
{
if (!s_DisableVirtualizationProperty)
{
s_DisableVirtualizationProperty =
InitializeDependencyProperty(
L"DisableVirtualization",
winrt::name_of<bool>(),
winrt::name_of<winrt::StackLayout>(),
false /* isAttached */,
ValueHelper<bool>::BoxedDefaultValue(),
winrt::PropertyChangedCallback(&OnDisableVirtualizationPropertyChanged));
}
if (!s_OrientationProperty)
{
s_OrientationProperty =
Expand All @@ -49,10 +61,19 @@ void StackLayoutProperties::EnsureProperties()

void StackLayoutProperties::ClearProperties()
{
s_DisableVirtualizationProperty = nullptr;
s_OrientationProperty = nullptr;
s_SpacingProperty = nullptr;
}

void StackLayoutProperties::OnDisableVirtualizationPropertyChanged(
winrt::DependencyObject const& sender,
winrt::DependencyPropertyChangedEventArgs const& args)
{
auto owner = sender.as<winrt::StackLayout>();
winrt::get_self<StackLayout>(owner)->OnPropertyChanged(args);
}

void StackLayoutProperties::OnOrientationPropertyChanged(
winrt::DependencyObject const& sender,
winrt::DependencyPropertyChangedEventArgs const& args)
Expand All @@ -69,6 +90,16 @@ void StackLayoutProperties::OnSpacingPropertyChanged(
winrt::get_self<StackLayout>(owner)->OnPropertyChanged(args);
}

void StackLayoutProperties::DisableVirtualization(bool value)
{
static_cast<StackLayout*>(this)->SetValue(s_DisableVirtualizationProperty, ValueHelper<bool>::BoxValueIfNecessary(value));
}

bool StackLayoutProperties::DisableVirtualization()
{
return ValueHelper<bool>::CastOrUnbox(static_cast<StackLayout*>(this)->GetValue(s_DisableVirtualizationProperty));
}

void StackLayoutProperties::Orientation(winrt::Orientation const& value)
{
static_cast<StackLayout*>(this)->SetValue(s_OrientationProperty, ValueHelper<winrt::Orientation>::BoxValueIfNecessary(value));
Expand Down
9 changes: 9 additions & 0 deletions dev/Generated/StackLayout.properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,30 @@ class StackLayoutProperties
public:
StackLayoutProperties();

void DisableVirtualization(bool value);
bool DisableVirtualization();

void Orientation(winrt::Orientation const& value);
winrt::Orientation Orientation();

void Spacing(double value);
double Spacing();

static winrt::DependencyProperty DisableVirtualizationProperty() { return s_DisableVirtualizationProperty; }
static winrt::DependencyProperty OrientationProperty() { return s_OrientationProperty; }
static winrt::DependencyProperty SpacingProperty() { return s_SpacingProperty; }

static GlobalDependencyProperty s_DisableVirtualizationProperty;
static GlobalDependencyProperty s_OrientationProperty;
static GlobalDependencyProperty s_SpacingProperty;

static void EnsureProperties();
static void ClearProperties();

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

static void OnOrientationPropertyChanged(
winrt::DependencyObject const& sender,
winrt::DependencyPropertyChangedEventArgs const& args);
Expand Down
Loading

0 comments on commit f3862ec

Please sign in to comment.