Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Samples/Native/MyApp/MainUserControl.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "pch.h"
#include "MainUserControl.h"
#include <TreeViewNodeViewModel.h>

using namespace winrt;
using namespace Windows::UI::Xaml;
Expand All @@ -10,15 +11,21 @@ namespace winrt::MyApp::implementation
{

InitializeComponent();
for (int i = 0; i < 800; i++) {
auto child = winrt::make<MyApp::implementation::TreeViewNodeViewModel>(L"Label", winrt::Windows::Foundation::Uri{ nullptr }, L"");

treeView().Nodes().Append(child);
}
}

winrt::hstring MainUserControl::MyProperty()
{
return userControl().MyProperty();
return hstring{};
// return userControl().MyProperty();
}

void MainUserControl::MyProperty(winrt::hstring value)
{
userControl().MyProperty(value);
// userControl().MyProperty(value);
}
}
8 changes: 2 additions & 6 deletions Samples/Native/MyApp/MainUserControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
XYFocusKeyboardNavigation="Enabled"
mc:Ignorable="d">

<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" XYFocusKeyboardNavigation="Enabled">
<my:MyUserControl MyProperty="Hello from Xaml!" XYFocusKeyboardNavigation="Enabled" x:Name="userControl"/>
<muxc:ColorPicker XYFocusKeyboardNavigation="Enabled" />
<muxc:NavigationView PaneTitle="Welcome">
<TextBlock Text="Win UI Navigation" VerticalAlignment="Center" HorizontalAlignment="Center" Style="{StaticResource TitleTextBlockStyle}"/>
</muxc:NavigationView>
<StackPanel>
<local:TreeViewHostUserControl x:Name="treeView"></local:TreeViewHostUserControl>
</StackPanel>
</UserControl>
6 changes: 3 additions & 3 deletions Samples/Native/MyApp/MyApp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -343,21 +343,21 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.3.191125001-prerelease\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.3.191125001-prerelease\build\native\Microsoft.UI.Xaml.targets')" />
<Import Project="..\..\..\packages\SceneLoaderComponent.1.0.0.1\build\native\SceneLoaderComponent.targets" Condition="'$(Platform)'=='x64' and Exists('..\..\..\packages\SceneLoaderComponent.1.0.0.1\build\native\SceneLoaderComponent.targets')" />
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.191111.2\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.191111.2\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210816001\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210816001\build\native\Microsoft.UI.Xaml.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.3.191125001-prerelease\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.3.191125001-prerelease\build\native\Microsoft.UI.Xaml.targets'))" />
<Error Condition="!Exists('..\..\..\packages\SceneLoaderComponent.1.0.0.1\build\native\SceneLoaderComponent.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\SceneLoaderComponent.1.0.0.1\build\native\SceneLoaderComponent.props'))" />
<Error Condition="!Exists('..\..\..\packages\SceneLoaderComponent.1.0.0.1\build\native\SceneLoaderComponent.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\SceneLoaderComponent.1.0.0.1\build\native\SceneLoaderComponent.targets'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.2\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.191111.2\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.191111.2\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.191111.2\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.191111.2\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210816001\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210816001\build\native\Microsoft.UI.Xaml.targets'))" />
</Target>
</Project>
</Project>
2 changes: 1 addition & 1 deletion Samples/Native/MyApp/MyApp.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
<Midl Include="TreeViewNodeViewModel.idl" />
<Midl Include="FilePathToBitmapImageConverter.idl" />
</ItemGroup>
</Project>
</Project>
6 changes: 5 additions & 1 deletion Samples/Native/MyApp/TreeViewHostUserControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
<ResourceDictionary Source="ms-appx:///Microsoft.UI.Xaml/DensityStyles/Compact.xaml" />
</UserControl.Resources>
<Grid>
<muxc:TreeView ItemInvoked="TreeView_ItemInvoked" ItemsSource="{x:Bind Nodes}" ScrollViewer.HorizontalScrollMode="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<muxc:TreeView Grid.Column="1" SelectionMode="Multiple" ItemInvoked="TreeView_ItemInvoked" ItemsSource="{x:Bind Nodes}" ScrollViewer.HorizontalScrollMode="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto">
<muxc:TreeView.ItemTemplate>
<DataTemplate x:DataType="local:TreeViewNodeViewModel">
<muxc:TreeViewItem ItemsSource="{x:Bind Children}">
Expand Down
2 changes: 1 addition & 1 deletion Samples/Native/MyApp/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.2" targetFramework="native" />
<package id="Microsoft.UI.Xaml" version="2.3.191125001-prerelease" targetFramework="native" />
<package id="Microsoft.UI.Xaml" version="2.7.0-prerelease.210816001" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.191111.2" targetFramework="native" />
<package id="SceneLoaderComponent" version="1.0.0.1" targetFramework="native" />
</packages>