Skip to content
Closed
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
15 changes: 0 additions & 15 deletions vsix/ItemTemplates/BlankPage/BlankPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,4 @@ namespace winrt::$rootnamespace$::implementation
{
InitializeComponent();
}

int32_t $safeitemname$::MyProperty()
{
throw hresult_not_implemented();
}

void $safeitemname$::MyProperty(int32_t /* value */)
{
throw hresult_not_implemented();
}

void $safeitemname$::ClickHandler(IInspectable const&, RoutedEventArgs const&)
{
Button().Content(box_value(L"Clicked"));
}
}
6 changes: 0 additions & 6 deletions vsix/ItemTemplates/BlankPage/BlankPage.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
#pragma once

#include "$safeitemname$.g.h"

namespace winrt::$rootnamespace$::implementation
{
struct $safeitemname$ : $safeitemname$T<$safeitemname$>
{
$safeitemname$();

int32_t MyProperty();
void MyProperty(int32_t value);

void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
};
}

Expand Down
1 change: 0 additions & 1 deletion vsix/ItemTemplates/BlankPage/BlankPage.idl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ namespace $rootnamespace$
runtimeclass $safeitemname$ : Windows.UI.Xaml.Controls.Page
{
$safeitemname$();
Int32 MyProperty;
}
}
6 changes: 2 additions & 4 deletions vsix/ItemTemplates/BlankPage/BlankPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
x:Class="$rootnamespace$.$safeitemname$"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:$rootnamespace$"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:$rootnamespace$"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button x:Name="Button" Click="ClickHandler">Click Me</Button>
</StackPanel>
<Grid />
</Page>
15 changes: 0 additions & 15 deletions vsix/ItemTemplates/BlankUserControl/BlankUserControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,4 @@ namespace winrt::$rootnamespace$::implementation
{
InitializeComponent();
}

int32_t $safeitemname$::MyProperty()
{
throw hresult_not_implemented();
}

void $safeitemname$::MyProperty(int32_t /* value */)
{
throw hresult_not_implemented();
}

void $safeitemname$::ClickHandler(IInspectable const&, RoutedEventArgs const&)
{
Button().Content(box_value(L"Clicked"));
}
}
6 changes: 0 additions & 6 deletions vsix/ItemTemplates/BlankUserControl/BlankUserControl.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once

#include "winrt/Windows.UI.Xaml.h"
#include "winrt/Windows.UI.Xaml.Markup.h"
#include "winrt/Windows.UI.Xaml.Interop.h"
Expand All @@ -11,11 +10,6 @@ namespace winrt::$rootnamespace$::implementation
struct $safeitemname$ : $safeitemname$T<$safeitemname$>
{
$safeitemname$();

int32_t MyProperty();
void MyProperty(int32_t value);

void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
};
}

Expand Down
1 change: 0 additions & 1 deletion vsix/ItemTemplates/BlankUserControl/BlankUserControl.idl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ namespace $rootnamespace$
runtimeclass $safeitemname$ : Windows.UI.Xaml.Controls.UserControl
{
$safeitemname$();
Int32 MyProperty;
}
}
8 changes: 4 additions & 4 deletions vsix/ItemTemplates/BlankUserControl/BlankUserControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
x:Class="$rootnamespace$.$safeitemname$"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:$rootnamespace$"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:$rootnamespace$"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button x:Name="Button" Click="ClickHandler">Click Me</Button>
</StackPanel>
<Grid>

</Grid>
</UserControl>
11 changes: 7 additions & 4 deletions vsix/ItemTemplates/ViewModel/ViewModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
#include "$safeitemname$.g.cpp"
#endif

using namespace winrt;
using namespace Windows::UI::Xaml::Data;

namespace winrt::$rootnamespace$::implementation
{
int32_t $safeitemname$::MyProperty()
event_token $safeitemname$::PropertyChanged(PropertyChangedEventHandler const& handler)
{
throw hresult_not_implemented();
return m_PropertyChanged.add(handler);
}

void $safeitemname$::MyProperty(int32_t /*value*/)
void $safeitemname$::PropertyChanged(event_token token) noexcept
{
throw hresult_not_implemented();
m_PropertyChanged.remove(token);
}
}
8 changes: 5 additions & 3 deletions vsix/ItemTemplates/ViewModel/ViewModel.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once

#include "winrt/Windows.UI.Xaml.Data.h"
#include "$safeitemname$.g.h"

namespace winrt::$rootnamespace$::implementation
Expand All @@ -8,8 +8,10 @@ namespace winrt::$rootnamespace$::implementation
{
$safeitemname$() = default;

int32_t MyProperty();
void MyProperty(int32_t value);
event_token PropertyChanged(Windows::UI::Xaml::Data::PropertyChangedEventHandler const& handler);
void PropertyChanged(event_token token) noexcept;
private:
event<Windows::UI::Xaml::Data::PropertyChangedEventHandler> m_PropertyChanged;
};
}

Expand Down
3 changes: 1 addition & 2 deletions vsix/ItemTemplates/ViewModel/ViewModel.idl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ namespace $rootnamespace$
{
[bindable]
[default_interface]
runtimeclass $safeitemname$
runtimeclass $safeitemname$ : Windows.UI.Xaml.Data.INotifyPropertyChanged
{
$safeitemname$();
Int32 MyProperty;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once

#include <windows.h>
#ifdef GetCurrentTime
#undef GetCurrentTime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "pch.h"

#include "App.h"
#include "MainPage.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using namespace winrt;
using namespace Windows::UI::Xaml;
using namespace Windows::Foundation;

namespace winrt::$safeprojectname$::implementation
{
Expand All @@ -17,7 +18,7 @@ namespace winrt::$safeprojectname$::implementation
throw hresult_not_implemented();
}

void MainPage::MyProperty(int32_t /* value */)
void MainPage::MyProperty([[maybe_unused]] int32_t value)
{
throw hresult_not_implemented();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once

#include "MainPage.g.h"

namespace winrt::$safeprojectname$::implementation
Expand All @@ -10,7 +9,6 @@ namespace winrt::$safeprojectname$::implementation

int32_t MyProperty();
void MyProperty(int32_t value);

void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Page
<Page
x:Class="$safeprojectname$.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:$safeprojectname$"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:$safeprojectname$"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
<Button x:Name="myButton" Click="ClickHandler">Click Me</Button>
</StackPanel>
</Page>
1 change: 0 additions & 1 deletion vsix/ProjectTemplates/VC/Windows Universal/CoreApp/App.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "pch.h"

using namespace winrt;

using namespace Windows;
using namespace Windows::ApplicationModel::Core;
using namespace Windows::Foundation::Numerics;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace winrt::$safeprojectname$::implementation
throw hresult_not_implemented();
}

void Class::MyProperty(int32_t /* value */)
void Class::MyProperty([[maybe_unused]] int32_t value)
{
throw hresult_not_implemented();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once

#include "Class.g.h"

namespace winrt::$safeprojectname$::implementation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace winrt::$safeprojectname$::implementation
throw hresult_not_implemented();
}

void Class::MyProperty(int32_t /* value */)
void Class::MyProperty([[maybe_unused]] int32_t value)
{
throw hresult_not_implemented();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once

#include "Class.g.h"

namespace winrt::$safeprojectname$::implementation
Expand Down