Skip to content

Commit

Permalink
Switch from wux to mux where possible (#157)
Browse files Browse the repository at this point in the history
* switch from wux to mux where possible

* Workarounds for Microsoft.Windows.SDK.WinUI.Contracts and Microsoft.WinUI nuget issues

* PR feedback
  • Loading branch information
Scottj1s authored Apr 20, 2020
1 parent 23332fa commit f312cf5
Show file tree
Hide file tree
Showing 34 changed files with 1,022 additions and 966 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<VCProjectVersion>15.0</VCProjectVersion>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<CppWinRTVerbosity>high</CppWinRTVerbosity>
<MicrosoftWinUIVersion>3.0.0-preview1.200407.3-CI</MicrosoftWinUIVersion>
<MicrosoftWinUIVersion>3.0.0-preview1.200419.0-CI</MicrosoftWinUIVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(VisualStudioVersion)' == '15.0'">
Expand Down
45 changes: 23 additions & 22 deletions TestComponentCSharp/Class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ using namespace std::chrono;
using namespace winrt;
using namespace Windows::Foundation;
using namespace Collections;
using namespace Windows::UI::Xaml::Interop;
using namespace Microsoft::UI::Xaml::Interop;
using Windows::UI::Xaml::Interop::TypeName;

namespace winrt::TestComponentCSharp::implementation
{
Expand Down Expand Up @@ -778,75 +779,75 @@ namespace winrt::TestComponentCSharp::implementation
_color = value;
}

Windows::UI::Xaml::CornerRadius Class::CornerRadiusProperty()
Microsoft::UI::Xaml::CornerRadius Class::CornerRadiusProperty()
{
return _cornerRadius;
}
void Class::CornerRadiusProperty(Windows::UI::Xaml::CornerRadius const& value)
void Class::CornerRadiusProperty(Microsoft::UI::Xaml::CornerRadius const& value)
{
_cornerRadius = value;
}
Windows::UI::Xaml::Duration Class::DurationProperty()
Microsoft::UI::Xaml::Duration Class::DurationProperty()
{
return _duration;
}
void Class::DurationProperty(Windows::UI::Xaml::Duration const& value)
void Class::DurationProperty(Microsoft::UI::Xaml::Duration const& value)
{
_duration = value;
}
Windows::UI::Xaml::GridLength Class::GridLengthProperty()
Microsoft::UI::Xaml::GridLength Class::GridLengthProperty()
{
return _gridLength;
}
void Class::GridLengthProperty(Windows::UI::Xaml::GridLength const& value)
void Class::GridLengthProperty(Microsoft::UI::Xaml::GridLength const& value)
{
_gridLength = value;
}
Windows::UI::Xaml::Thickness Class::ThicknessProperty()
Microsoft::UI::Xaml::Thickness Class::ThicknessProperty()
{
return _thickness;
}
void Class::ThicknessProperty(Windows::UI::Xaml::Thickness const& value)
void Class::ThicknessProperty(Microsoft::UI::Xaml::Thickness const& value)
{
_thickness = value;
}
Windows::UI::Xaml::Controls::Primitives::GeneratorPosition Class::GeneratorPositionProperty()
Microsoft::UI::Xaml::Controls::Primitives::GeneratorPosition Class::GeneratorPositionProperty()
{
return _generatorPosition;
}
void Class::GeneratorPositionProperty(Windows::UI::Xaml::Controls::Primitives::GeneratorPosition const& value)
void Class::GeneratorPositionProperty(Microsoft::UI::Xaml::Controls::Primitives::GeneratorPosition const& value)
{
_generatorPosition = value;
}
Windows::UI::Xaml::Media::Matrix Class::MatrixProperty()
Microsoft::UI::Xaml::Media::Matrix Class::MatrixProperty()
{
return _matrix;
}
void Class::MatrixProperty(Windows::UI::Xaml::Media::Matrix const& value)
void Class::MatrixProperty(Microsoft::UI::Xaml::Media::Matrix const& value)
{
_matrix = value;
}
Windows::UI::Xaml::Media::Animation::KeyTime Class::KeyTimeProperty()
Microsoft::UI::Xaml::Media::Animation::KeyTime Class::KeyTimeProperty()
{
return _keyTime;
}
void Class::KeyTimeProperty(Windows::UI::Xaml::Media::Animation::KeyTime const& value)
void Class::KeyTimeProperty(Microsoft::UI::Xaml::Media::Animation::KeyTime const& value)
{
_keyTime = value;
}
Windows::UI::Xaml::Media::Animation::RepeatBehavior Class::RepeatBehaviorProperty()
Microsoft::UI::Xaml::Media::Animation::RepeatBehavior Class::RepeatBehaviorProperty()
{
return _repeatBehavior;
}
void Class::RepeatBehaviorProperty(Windows::UI::Xaml::Media::Animation::RepeatBehavior const& value)
void Class::RepeatBehaviorProperty(Microsoft::UI::Xaml::Media::Animation::RepeatBehavior const& value)
{
_repeatBehavior = value;
}
Windows::UI::Xaml::Media::Media3D::Matrix3D Class::Matrix3DProperty()
Microsoft::UI::Xaml::Media::Media3D::Matrix3D Class::Matrix3DProperty()
{
return _matrix3D;
}
void Class::Matrix3DProperty(Windows::UI::Xaml::Media::Media3D::Matrix3D const& value)
void Class::Matrix3DProperty(Microsoft::UI::Xaml::Media::Media3D::Matrix3D const& value)
{
_matrix3D = value;
}
Expand Down Expand Up @@ -1054,9 +1055,9 @@ namespace winrt::TestComponentCSharp::implementation
[](IBindableObservableVector vector, IInspectable e) {
int32_t sum = 0;
auto view = vector.GetView();
for (uint32_t i = 0; i < view.Size(); i++)
{
sum += winrt::unbox_value<int32_t>(view.GetAt(i));
for (uint32_t i = 0; i < view.Size(); i++)
{
sum += winrt::unbox_value<int32_t>(view.GetAt(i));
}
e.as<IProperties2>().ReadWriteProperty(sum);
});
Expand Down
80 changes: 40 additions & 40 deletions TestComponentCSharp/Class.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,27 @@ namespace winrt::TestComponentCSharp::implementation
ComposedNonBlittableStruct _nonBlittableStruct{};
std::vector<int32_t> _ints{ 1, 2, 3 };
Windows::Foundation::Collections::IIterable<int32_t> _intColl;
Windows::UI::Xaml::Interop::IBindableIterable _bindableIterable;
Windows::UI::Xaml::Interop::IBindableVector _bindableVector;
Windows::UI::Xaml::Interop::IBindableObservableVector _bindableObservable;
winrt::event<Windows::Foundation::EventHandler<Windows::UI::Xaml::Interop::IBindableIterable>> _bindableIterableChanged;
winrt::event<Windows::Foundation::EventHandler<Windows::UI::Xaml::Interop::IBindableVector>> _bindableVectorChanged;
Microsoft::UI::Xaml::Interop::IBindableIterable _bindableIterable;
Microsoft::UI::Xaml::Interop::IBindableVector _bindableVector;
Microsoft::UI::Xaml::Interop::IBindableObservableVector _bindableObservable;
winrt::event<Windows::Foundation::EventHandler<Microsoft::UI::Xaml::Interop::IBindableIterable>> _bindableIterableChanged;
winrt::event<Windows::Foundation::EventHandler<Microsoft::UI::Xaml::Interop::IBindableVector>> _bindableVectorChanged;
winrt::handle _syncHandle;
int32_t _asyncResult;
int32_t _asyncProgress;
Windows::Foundation::Point _point{};
Windows::Foundation::Rect _rect{};
Windows::Foundation::Size _size{};
Windows::UI::Color _color{};
Windows::UI::Xaml::CornerRadius _cornerRadius{};
Windows::UI::Xaml::Duration _duration{};
Windows::UI::Xaml::GridLength _gridLength{};
Windows::UI::Xaml::Thickness _thickness{};
Windows::UI::Xaml::Controls::Primitives::GeneratorPosition _generatorPosition{};
Windows::UI::Xaml::Media::Matrix _matrix{};
Windows::UI::Xaml::Media::Animation::KeyTime _keyTime{};
Windows::UI::Xaml::Media::Animation::RepeatBehavior _repeatBehavior{};
Windows::UI::Xaml::Media::Media3D::Matrix3D _matrix3D{};
Microsoft::UI::Xaml::CornerRadius _cornerRadius{};
Microsoft::UI::Xaml::Duration _duration{};
Microsoft::UI::Xaml::GridLength _gridLength{};
Microsoft::UI::Xaml::Thickness _thickness{};
Microsoft::UI::Xaml::Controls::Primitives::GeneratorPosition _generatorPosition{};
Microsoft::UI::Xaml::Media::Matrix _matrix{};
Microsoft::UI::Xaml::Media::Animation::KeyTime _keyTime{};
Microsoft::UI::Xaml::Media::Animation::RepeatBehavior _repeatBehavior{};
Microsoft::UI::Xaml::Media::Media3D::Matrix3D _matrix3D{};
Windows::Foundation::Numerics::float3x2 _matrix3x2;
Windows::Foundation::Numerics::float4x4 _matrix4x4;
Windows::Foundation::Numerics::plane _plane;
Expand Down Expand Up @@ -193,20 +193,20 @@ namespace winrt::TestComponentCSharp::implementation
Windows::Foundation::Collections::IIterable<int32_t> GetIntIterable();
void SetIntIterable(Windows::Foundation::Collections::IIterable<int32_t> const& value);

Windows::UI::Xaml::Interop::IBindableIterable BindableIterableProperty();
void BindableIterableProperty(Windows::UI::Xaml::Interop::IBindableIterable const& value);
Microsoft::UI::Xaml::Interop::IBindableIterable BindableIterableProperty();
void BindableIterableProperty(Microsoft::UI::Xaml::Interop::IBindableIterable const& value);
void RaiseBindableIterableChanged();
void CallForBindableIterable(TestComponentCSharp::ProvideBindableIterable const& provideBindableIterable);
winrt::event_token BindableIterablePropertyChanged(Windows::Foundation::EventHandler<Windows::UI::Xaml::Interop::IBindableIterable> const& handler);
winrt::event_token BindableIterablePropertyChanged(Windows::Foundation::EventHandler<Microsoft::UI::Xaml::Interop::IBindableIterable> const& handler);
void BindableIterablePropertyChanged(winrt::event_token const& token) noexcept;
Windows::UI::Xaml::Interop::IBindableVector BindableVectorProperty();
void BindableVectorProperty(Windows::UI::Xaml::Interop::IBindableVector const& value);
Microsoft::UI::Xaml::Interop::IBindableVector BindableVectorProperty();
void BindableVectorProperty(Microsoft::UI::Xaml::Interop::IBindableVector const& value);
void RaiseBindableVectorChanged();
void CallForBindableVector(TestComponentCSharp::ProvideBindableVector const& provideBindableVector);
winrt::event_token BindableVectorPropertyChanged(Windows::Foundation::EventHandler<Windows::UI::Xaml::Interop::IBindableVector> const& handler);
winrt::event_token BindableVectorPropertyChanged(Windows::Foundation::EventHandler<Microsoft::UI::Xaml::Interop::IBindableVector> const& handler);
void BindableVectorPropertyChanged(winrt::event_token const& token) noexcept;
Windows::UI::Xaml::Interop::IBindableObservableVector BindableObservableVectorProperty();
void BindableObservableVectorProperty(Windows::UI::Xaml::Interop::IBindableObservableVector const& value);
Microsoft::UI::Xaml::Interop::IBindableObservableVector BindableObservableVectorProperty();
void BindableObservableVectorProperty(Microsoft::UI::Xaml::Interop::IBindableObservableVector const& value);

void CopyProperties(TestComponentCSharp::IProperties1 const& src);
void CopyPropertiesViaWeakReference(TestComponentCSharp::IProperties1 const& src);
Expand All @@ -227,24 +227,24 @@ namespace winrt::TestComponentCSharp::implementation
void SizeProperty(Windows::Foundation::Size const& value);
Windows::UI::Color ColorProperty();
void ColorProperty(Windows::UI::Color const& value);
Windows::UI::Xaml::CornerRadius CornerRadiusProperty();
void CornerRadiusProperty(Windows::UI::Xaml::CornerRadius const& value);
Windows::UI::Xaml::Duration DurationProperty();
void DurationProperty(Windows::UI::Xaml::Duration const& value);
Windows::UI::Xaml::GridLength GridLengthProperty();
void GridLengthProperty(Windows::UI::Xaml::GridLength const& value);
Windows::UI::Xaml::Thickness ThicknessProperty();
void ThicknessProperty(Windows::UI::Xaml::Thickness const& value);
Windows::UI::Xaml::Controls::Primitives::GeneratorPosition GeneratorPositionProperty();
void GeneratorPositionProperty(Windows::UI::Xaml::Controls::Primitives::GeneratorPosition const& value);
Windows::UI::Xaml::Media::Matrix MatrixProperty();
void MatrixProperty(Windows::UI::Xaml::Media::Matrix const& value);
Windows::UI::Xaml::Media::Animation::KeyTime KeyTimeProperty();
void KeyTimeProperty(Windows::UI::Xaml::Media::Animation::KeyTime const& value);
Windows::UI::Xaml::Media::Animation::RepeatBehavior RepeatBehaviorProperty();
void RepeatBehaviorProperty(Windows::UI::Xaml::Media::Animation::RepeatBehavior const& value);
Windows::UI::Xaml::Media::Media3D::Matrix3D Matrix3DProperty();
void Matrix3DProperty(Windows::UI::Xaml::Media::Media3D::Matrix3D const& value);
Microsoft::UI::Xaml::CornerRadius CornerRadiusProperty();
void CornerRadiusProperty(Microsoft::UI::Xaml::CornerRadius const& value);
Microsoft::UI::Xaml::Duration DurationProperty();
void DurationProperty(Microsoft::UI::Xaml::Duration const& value);
Microsoft::UI::Xaml::GridLength GridLengthProperty();
void GridLengthProperty(Microsoft::UI::Xaml::GridLength const& value);
Microsoft::UI::Xaml::Thickness ThicknessProperty();
void ThicknessProperty(Microsoft::UI::Xaml::Thickness const& value);
Microsoft::UI::Xaml::Controls::Primitives::GeneratorPosition GeneratorPositionProperty();
void GeneratorPositionProperty(Microsoft::UI::Xaml::Controls::Primitives::GeneratorPosition const& value);
Microsoft::UI::Xaml::Media::Matrix MatrixProperty();
void MatrixProperty(Microsoft::UI::Xaml::Media::Matrix const& value);
Microsoft::UI::Xaml::Media::Animation::KeyTime KeyTimeProperty();
void KeyTimeProperty(Microsoft::UI::Xaml::Media::Animation::KeyTime const& value);
Microsoft::UI::Xaml::Media::Animation::RepeatBehavior RepeatBehaviorProperty();
void RepeatBehaviorProperty(Microsoft::UI::Xaml::Media::Animation::RepeatBehavior const& value);
Microsoft::UI::Xaml::Media::Media3D::Matrix3D Matrix3DProperty();
void Matrix3DProperty(Microsoft::UI::Xaml::Media::Media3D::Matrix3D const& value);
Windows::Foundation::Numerics::float3x2 Matrix3x2Property();
void Matrix3x2Property(Windows::Foundation::Numerics::float3x2 const& value);
Windows::Foundation::Numerics::float4x4 Matrix4x4Property();
Expand Down
10 changes: 10 additions & 0 deletions TestComponentCSharp/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />

<!--Only need the WinUI winmd files for compiling idl, so stub out Xaml targets-->
<Target Name="MarkupCompilePass1" />
<Target Name="MarkupCompilePass2" />
<Target Name="Prep_ComputeProcessXamlFiles" />

</Project>
32 changes: 16 additions & 16 deletions TestComponentCSharp/TestComponentCSharp.idl
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ namespace TestComponentCSharp
delegate Object ProvideObject();
delegate Windows.Foundation.Uri ProvideUri();
delegate Windows.Foundation.Collections.IKeyValuePair<String, String> ProvideStringPair();
delegate Windows.UI.Xaml.Interop.IBindableIterable ProvideBindableIterable();
delegate Windows.UI.Xaml.Interop.IBindableVector ProvideBindableVector();
delegate Microsoft.UI.Xaml.Interop.IBindableIterable ProvideBindableIterable();
delegate Microsoft.UI.Xaml.Interop.IBindableVector ProvideBindableVector();

interface ICowboy
{
Expand Down Expand Up @@ -220,17 +220,17 @@ namespace TestComponentCSharp
void SetIntIterable(Windows.Foundation.Collections.IIterable<Int32> value);

// Bindable
Windows.UI.Xaml.Interop.IBindableIterable BindableIterableProperty;
Microsoft.UI.Xaml.Interop.IBindableIterable BindableIterableProperty;
void RaiseBindableIterableChanged();
void CallForBindableIterable(ProvideBindableIterable provideBindableIterable);
event Windows.Foundation.EventHandler<Windows.UI.Xaml.Interop.IBindableIterable> BindableIterablePropertyChanged;
event Windows.Foundation.EventHandler<Microsoft.UI.Xaml.Interop.IBindableIterable> BindableIterablePropertyChanged;

Windows.UI.Xaml.Interop.IBindableVector BindableVectorProperty;
Microsoft.UI.Xaml.Interop.IBindableVector BindableVectorProperty;
void RaiseBindableVectorChanged();
void CallForBindableVector(ProvideBindableVector provideBindableVector);
event Windows.Foundation.EventHandler<Windows.UI.Xaml.Interop.IBindableVector> BindableVectorPropertyChanged;
event Windows.Foundation.EventHandler<Microsoft.UI.Xaml.Interop.IBindableVector> BindableVectorPropertyChanged;

Windows.UI.Xaml.Interop.IBindableObservableVector BindableObservableVectorProperty;
Microsoft.UI.Xaml.Interop.IBindableObservableVector BindableObservableVectorProperty;

void CopyProperties(IProperties1 src);
void CopyPropertiesViaWeakReference(IProperties1 src);
Expand All @@ -251,15 +251,15 @@ namespace TestComponentCSharp
Windows.Foundation.Rect RectProperty;
Windows.Foundation.Size SizeProperty;
Windows.UI.Color ColorProperty;
Windows.UI.Xaml.CornerRadius CornerRadiusProperty;
Windows.UI.Xaml.Duration DurationProperty;
Windows.UI.Xaml.GridLength GridLengthProperty;
Windows.UI.Xaml.Thickness ThicknessProperty;
Windows.UI.Xaml.Controls.Primitives.GeneratorPosition GeneratorPositionProperty;
Windows.UI.Xaml.Media.Matrix MatrixProperty;
Windows.UI.Xaml.Media.Animation.KeyTime KeyTimeProperty;
Windows.UI.Xaml.Media.Animation.RepeatBehavior RepeatBehaviorProperty;
Windows.UI.Xaml.Media.Media3D.Matrix3D Matrix3DProperty;
Microsoft.UI.Xaml.CornerRadius CornerRadiusProperty;
Microsoft.UI.Xaml.Duration DurationProperty;
Microsoft.UI.Xaml.GridLength GridLengthProperty;
Microsoft.UI.Xaml.Thickness ThicknessProperty;
Microsoft.UI.Xaml.Controls.Primitives.GeneratorPosition GeneratorPositionProperty;
Microsoft.UI.Xaml.Media.Matrix MatrixProperty;
Microsoft.UI.Xaml.Media.Animation.KeyTime KeyTimeProperty;
Microsoft.UI.Xaml.Media.Animation.RepeatBehavior RepeatBehaviorProperty;
Microsoft.UI.Xaml.Media.Media3D.Matrix3D Matrix3DProperty;
Windows.Foundation.Numerics.Matrix3x2 Matrix3x2Property;
Windows.Foundation.Numerics.Matrix4x4 Matrix4x4Property;
Windows.Foundation.Numerics.Plane PlaneProperty;
Expand Down
Loading

0 comments on commit f312cf5

Please sign in to comment.