diff --git a/src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml.Controls/SwipeItemInvokedEventArgs.cs b/src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml.Controls/SwipeItemInvokedEventArgs.cs index a1be0bd5d540..28938a048f46 100644 --- a/src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml.Controls/SwipeItemInvokedEventArgs.cs +++ b/src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml.Controls/SwipeItemInvokedEventArgs.cs @@ -2,12 +2,12 @@ #pragma warning disable 114 // new keyword hiding namespace Windows.UI.Xaml.Controls { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented] #endif public partial class SwipeItemInvokedEventArgs { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public global::Windows.UI.Xaml.Controls.SwipeControl SwipeControl { diff --git a/src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml.Controls/SwipeItems.cs b/src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml.Controls/SwipeItems.cs index 0ecd58740665..4375859db820 100644 --- a/src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml.Controls/SwipeItems.cs +++ b/src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml.Controls/SwipeItems.cs @@ -2,12 +2,12 @@ #pragma warning disable 114 // new keyword hiding namespace Windows.UI.Xaml.Controls { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented] #endif public partial class SwipeItems : global::Windows.UI.Xaml.DependencyObject,global::System.Collections.Generic.IList,global::System.Collections.Generic.IEnumerable { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public uint Size { @@ -17,7 +17,7 @@ public uint Size } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public global::Windows.UI.Xaml.Controls.SwipeMode Mode { @@ -31,7 +31,7 @@ public uint Size } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public static global::Windows.UI.Xaml.DependencyProperty ModeProperty { get; } = Windows.UI.Xaml.DependencyProperty.Register( @@ -64,7 +64,7 @@ public SwipeItems() : base() // Forced skipping of method Windows.UI.Xaml.Controls.SwipeItems.First() // Forced skipping of method Windows.UI.Xaml.Controls.SwipeItems.ModeProperty.get // Processing: System.Collections.Generic.IList - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false // DeclaringType: System.Collections.Generic.IList [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public int IndexOf( global::Windows.UI.Xaml.Controls.SwipeItem item) @@ -72,7 +72,7 @@ public int IndexOf( global::Windows.UI.Xaml.Controls.SwipeItem item) throw new global::System.NotSupportedException(); } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false // DeclaringType: System.Collections.Generic.IList [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public void Insert( int index, global::Windows.UI.Xaml.Controls.SwipeItem item) @@ -80,7 +80,7 @@ public void Insert( int index, global::Windows.UI.Xaml.Controls.SwipeItem item) throw new global::System.NotSupportedException(); } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false // DeclaringType: System.Collections.Generic.IList [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public void RemoveAt( int index) @@ -88,7 +88,7 @@ public void RemoveAt( int index) throw new global::System.NotSupportedException(); } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public global::Windows.UI.Xaml.Controls.SwipeItem this[int index] { @@ -103,7 +103,7 @@ public void RemoveAt( int index) } #endif // Processing: System.Collections.Generic.ICollection - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false // DeclaringType: System.Collections.Generic.ICollection [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public void Add( global::Windows.UI.Xaml.Controls.SwipeItem item) @@ -111,7 +111,7 @@ public void Add( global::Windows.UI.Xaml.Controls.SwipeItem item) throw new global::System.NotSupportedException(); } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false // DeclaringType: System.Collections.Generic.ICollection [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public void Clear() @@ -119,7 +119,7 @@ public void Clear() throw new global::System.NotSupportedException(); } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false // DeclaringType: System.Collections.Generic.ICollection [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public bool Contains( global::Windows.UI.Xaml.Controls.SwipeItem item) @@ -127,7 +127,7 @@ public bool Contains( global::Windows.UI.Xaml.Controls.SwipeItem item) throw new global::System.NotSupportedException(); } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false // DeclaringType: System.Collections.Generic.ICollection [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public void CopyTo( global::Windows.UI.Xaml.Controls.SwipeItem[] array, int arrayIndex) @@ -135,7 +135,7 @@ public void CopyTo( global::Windows.UI.Xaml.Controls.SwipeItem[] array, int arr throw new global::System.NotSupportedException(); } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false // DeclaringType: System.Collections.Generic.ICollection [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public bool Remove( global::Windows.UI.Xaml.Controls.SwipeItem item) @@ -143,7 +143,7 @@ public bool Remove( global::Windows.UI.Xaml.Controls.SwipeItem item) throw new global::System.NotSupportedException(); } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public int Count { @@ -157,7 +157,7 @@ public int Count } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public bool IsReadOnly { @@ -172,7 +172,7 @@ public bool IsReadOnly } #endif // Processing: System.Collections.Generic.IEnumerable - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false // DeclaringType: System.Collections.Generic.IEnumerable [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public global::System.Collections.Generic.IEnumerator GetEnumerator() @@ -181,7 +181,7 @@ public bool IsReadOnly } #endif // Processing: System.Collections.IEnumerable - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false // DeclaringType: System.Collections.IEnumerable [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.Uno.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.Uno.cs new file mode 100644 index 000000000000..9f0a410acc71 --- /dev/null +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.Uno.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; + +namespace Windows.UI.Xaml.Controls +{ + public partial class SwipeItems + { + /// + public IEnumerator GetEnumerator() + => m_items.GetEnumerator(); + + /// + IEnumerator IEnumerable.GetEnumerator() + => m_items.GetEnumerator(); + + /// + public void Add(SwipeItem item) + => m_items.Add(item); + + /// + public bool Contains(SwipeItem item) + => m_items.Contains(item); + + /// + public void CopyTo(SwipeItem[] array, int arrayIndex) + => m_items.CopyTo(array, arrayIndex); + + /// + public bool Remove(SwipeItem item) + => m_items.Remove(item); + + /// + public int Count => m_items.Count; + + /// + public bool IsReadOnly => ((ICollection)m_items).IsReadOnly; + + /// + public int IndexOf(SwipeItem item) + => m_items.IndexOf(item); + + /// + public void Insert(int index, SwipeItem item) + => m_items.Insert(index, item); + + /// + public void RemoveAt(int index) + => m_items.RemoveAt(index); + + /// + public SwipeItem this[int index] + { + get => m_items[index]; + set => m_items[index] = value; + } + } +} diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.cs index ea3bde9c08d2..38f74e26326a 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.cs @@ -1,141 +1,146 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Windows.Foundation.Collections; namespace Windows.UI.Xaml.Controls { - public partial class SwipeItems + public partial class SwipeItems : DependencyObject, IEnumerable, IList, IObservableVector { public void SwipeItems() { // create the Collection - var collection = new Vector() > (); + var collection = new ObservableCollection(); - put_Items(collection); + Items = collection; } - void OnPropertyChanged(DependencyPropertyChangedEventArgs& args) + void OnPropertyChanged(DependencyPropertyChangedEventArgs args) { - if (args.Property() == s_ModeProperty) + if (args.Property == ModeProperty) { - if (unbox_value(args.NewValue()) == SwipeMode.Execute && m_items.get().Size() > 1) + if (((SwipeMode)args.NewValue) == SwipeMode.Execute && m_items.Count > 1) { - throw hresult_invalid_argument("Execute items should only have one item."); + throw new ArgumentException("Execute items should only have one item."); } } } - void SwipeItems.put_Items( - Collections.IVector& value) + private ObservableCollection Items { - if (Mode() == SwipeMode.Execute && value.Size() > 1) + set { - throw hresult_invalid_argument("Execute items should only have one item."); - } + if (Mode == SwipeMode.Execute && value.Count > 1) + { + throw new ArgumentException("Execute items should only have one item."); + } - m_items.set(value); - m_vectorChangedEventSource(this, null); + m_items = value; + m_vectorChangedEventSource?.Invoke(this, null); + } } - SwipeItem GetAt(uint index) + public SwipeItem GetAt(uint index) { - if (index >= m_items.get().Size()) + if (index >= m_items.Count) { - throw hresult_out_of_bounds(); + throw new IndexOutOfRangeException(); } - return m_items.get().GetAt(index); + return m_items[(int) index]; } - uint Size() - { - return m_items.get().Size(); - } + public uint Size => (uint)m_items.Count; - bool IndexOf(SwipeItem & value, uint32_t& index) + public bool IndexOf(SwipeItem value, out uint index) { - if (index >= m_items.get().Size()) + var i = m_items.IndexOf(value); + if (i < 0) { - throw hresult_out_of_bounds(); + index = 0; + return false; + } + else + { + index = (uint)i; + return true; } - - return m_items.get().IndexOf(value, index); } - void SetAt(uint index, SwipeItem & value) + public void SetAt(uint index, SwipeItem value) { - if (index >= m_items.get().Size()) + if (index >= m_items.Count) { - throw hresult_out_of_bounds(); + throw new IndexOutOfRangeException(); } - m_items.get().SetAt(index, value); - m_vectorChangedEventSource(this, null); + m_items[(int)index] = value; + m_vectorChangedEventSource?.Invoke(this, null); } - void InsertAt(uint index, SwipeItem & value) + public void InsertAt(uint index, SwipeItem value) { - if (Mode() == SwipeMode.Execute && m_items.get().Size() > 0) + if (Mode == SwipeMode.Execute && m_items.Count > 0) { - throw hresult_invalid_argument("Execute items should only have one item."); + throw new ArgumentException("Execute items should only have one item."); } - if (index > m_items.get().Size()) + if (index > m_items.Count) { - throw hresult_out_of_bounds(); + throw new IndexOutOfRangeException(); } - m_items.get().InsertAt(index, value); - m_vectorChangedEventSource(this, null); + m_items.Insert((int)index, value); + m_vectorChangedEventSource?.Invoke(this, null); } - void RemoveAt(uint index) + public void RemoveAt(uint index) { - if (index >= m_items.get().Size()) + if (index >= m_items.Count) { - throw hresult_out_of_bounds(); + throw new IndexOutOfRangeException(); } - m_items.get().RemoveAt(index); - m_vectorChangedEventSource(this, null); + m_items.RemoveAt((int)index); + m_vectorChangedEventSource?.Invoke(this, null); } - void Append(SwipeItem & value) + public void Append(SwipeItem value) { - if (Mode() == SwipeMode.Execute && m_items.get().Size() > 0) + if (Mode == SwipeMode.Execute && m_items.Count > 0) { - throw hresult_invalid_argument("Execute items should only have one item."); + throw new ArgumentException("Execute items should only have one item."); } - m_items.get().Append(value); - m_vectorChangedEventSource(this, null); + m_items.Add(value); + m_vectorChangedEventSource?.Invoke(this, null); } - void RemoveAtEnd() + public void RemoveAtEnd() { - m_items.get().RemoveAtEnd(); - m_vectorChangedEventSource(this, null); + m_items.RemoveAt(m_items.Count -1); + m_vectorChangedEventSource?.Invoke(this, null); } - void Clear() + public void Clear() { - m_items.get().Clear(); - m_vectorChangedEventSource(this, null); + m_items.Clear(); + m_vectorChangedEventSource?.Invoke(this, null); } - IVectorView GetView() - { - return m_items.get().GetView(); - } - - event_token VectorChanged(VectorChangedEventHandler & handler) - { - return m_vectorChangedEventSource.add(handler); - } + // TODO Uno + //public IVectorView GetView() + //{ + // return m_items.GetView(); + //} - void VectorChanged(event_token token) + public event VectorChangedEventHandler VectorChanged { - m_vectorChangedEventSource.remove(token); + add => m_vectorChangedEventSource += value; + remove => m_vectorChangedEventSource -= value; } } } diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.h.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.h.cs index 860623a8c065..746cdf92d0ec 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.h.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.h.cs @@ -1,50 +1,51 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Windows.Foundation.Collections; + #pragma once namespace Windows.UI.Xaml.Controls { - internal partial class SwipeItems + public partial class SwipeItems { - class SwipeItems : - public ReferenceTracker>, - public SwipeItemsProperties -{ -public: - SwipeItems(); - -#pragma region IVector - winrt.SwipeItem GetAt(uint index); - uint Size(); - winrt.IVectorView GetView(); - bool IndexOf(winrt.SwipeItem & value, uint32_t& index); - void SetAt(uint index, winrt.SwipeItem & value); - void InsertAt(uint index, winrt.SwipeItem & value); - void RemoveAt(uint index); - void Append(winrt.SwipeItem & value); - void RemoveAtEnd(); - void Clear(); - - // TODO: - winrt.IIterator First() { throw winrt.hresult_not_implemented(); } - uint GetMany(uint startIndex, winrt.array_view items) { throw winrt.hresult_not_implemented(); } - void ReplaceAll(winrt.array_view items) { throw winrt.hresult_not_implemented(); } -#pragma endregion - -#pragma region IObservableVector - winrt.event_token VectorChanged(winrt.VectorChangedEventHandler & handler); - void VectorChanged(winrt.event_token token); -#pragma endregion - - void OnPropertyChanged( winrt.DependencyPropertyChangedEventArgs& args); - -private: - void put_Items( winrt.Collections.IVector& value); - tracker_ref> m_items{ this }; - - event_source> m_vectorChangedEventSource{ this }; -}; + //public: + //SwipeItems(); + + #region IVector + //winrt.SwipeItem GetAt(uint index); + //uint Size(); + //winrt.IVectorView GetView(); + //bool IndexOf(winrt.SwipeItem & value, uint32_t& index); + //void SetAt(uint index, winrt.SwipeItem & value); + //void InsertAt(uint index, winrt.SwipeItem & value); + //void RemoveAt(uint index); + //void Append(winrt.SwipeItem & value); + //void RemoveAtEnd(); + //void Clear(); + + // TODO: + public SwipeItem First() { throw new NotImplementedException(); } + + public uint GetMany(uint startIndex, SwipeItem[] items) { throw new NotImplementedException(); } + + public void ReplaceAll(SwipeItem[] items) { throw new NotImplementedException(); } + #endregion + + #region IObservableVector + //winrt.event_token VectorChanged(winrt.VectorChangedEventHandler & handler); + //void VectorChanged(winrt.event_token token); + #endregion + + //void OnPropertyChanged( winrt.DependencyPropertyChangedEventArgs& args); + + //private: + //void put_Items( winrt.Collections.IVector& value); + private ObservableCollection m_items; + private event VectorChangedEventHandler m_vectorChangedEventSource; } } diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.properties.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.properties.cs index 8d746df37033..b4e43d270276 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.properties.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.properties.cs @@ -7,52 +7,61 @@ namespace Windows.UI.Xaml.Controls { public partial class SwipeItems { - GlobalDependencyProperty SwipeItemsProperties.s_ModeProperty{ null }; + public static DependencyProperty ModeProperty { get; }= DependencyProperty.Register( + "Mode", typeof(SwipeMode), typeof(SwipeItems), new PropertyMetadata(default(SwipeMode), OnModePropertyChanged)); -SwipeItemsProperties.SwipeItemsProperties() -{ - EnsureProperties(); -} + public SwipeMode Mode + { + get => (SwipeMode)GetValue(ModeProperty); + set => SetValue(ModeProperty, value); + } -void SwipeItemsProperties.EnsureProperties() -{ - if (!s_ModeProperty) - { - s_ModeProperty = - InitializeDependencyProperty( - "Mode", - winrt.name_of(), - winrt.name_of(), - false /* isAttached */, - ValueHelper.BoxValueIfNecessary(winrt.SwipeMode.Reveal), - winrt.PropertyChangedCallback(&OnModePropertyChanged)); - } -} + //GlobalDependencyProperty SwipeItemsProperties.s_ModeProperty{ null }; -void SwipeItemsProperties.ClearProperties() -{ - s_ModeProperty = null; -} + //SwipeItemsProperties.SwipeItemsProperties() + //{ + // EnsureProperties(); + //} -void SwipeItemsProperties.OnModePropertyChanged( - winrt.DependencyObject & sender, - winrt.DependencyPropertyChangedEventArgs & args) -{ - var owner = sender.as(); - winrt.get_self(owner).OnPropertyChanged(args); -} + //void SwipeItemsProperties.EnsureProperties() + //{ + // if (!s_ModeProperty) + // { + // s_ModeProperty = + // InitializeDependencyProperty( + // "Mode", + // winrt.name_of(), + // winrt.name_of(), + // false /* isAttached */, + // ValueHelper.BoxValueIfNecessary(winrt.SwipeMode.Reveal), + // winrt.PropertyChangedCallback(&OnModePropertyChanged)); + // } + //} -void SwipeItemsProperties.Mode(winrt.SwipeMode & value) -{ - [[gsl.suppress(con)]] - { - (SwipeItems)(this).SetValue(s_ModeProperty, ValueHelper.BoxValueIfNecessary(value)); - } -} + //void SwipeItemsProperties.ClearProperties() + //{ + // s_ModeProperty = null; + //} -winrt.SwipeMode SwipeItemsProperties.Mode() -{ - return ValueHelper.CastOrUnbox((SwipeItems)(this).GetValue(s_ModeProperty)); -} -} + private static void OnModePropertyChanged( + DependencyObject sender, + DependencyPropertyChangedEventArgs args) + { + var owner = sender as SwipeItems; + owner.OnPropertyChanged(args); + } + + //void SwipeItemsProperties.Mode(winrt.SwipeMode & value) + //{ + // [[gsl.suppress(con)]] + // { + // (SwipeItems)(this).SetValue(s_ModeProperty, ValueHelper.BoxValueIfNecessary(value)); + // } + //} + + //winrt.SwipeMode SwipeItemsProperties.Mode() + //{ + // return ValueHelper.CastOrUnbox((SwipeItems)(this).GetValue(s_ModeProperty)); + //} + } } diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.properties.h.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.properties.h.cs index be64ad9a7301..85966faa62c3 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.properties.h.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.properties.h.cs @@ -5,27 +5,27 @@ namespace Windows.UI.Xaml.Controls { - internal partial class SwipeItems + public partial class SwipeItems { - public: + //public: - SwipeItemsProperties(); + //SwipeItemsProperties(); - void Mode(winrt.SwipeMode & value); + //void Mode(winrt.SwipeMode & value); - winrt.SwipeMode Mode(); + //winrt.SwipeMode Mode(); - static winrt.DependencyProperty ModeProperty() { return s_ModeProperty; } + //static winrt.DependencyProperty ModeProperty() { return s_ModeProperty; } - static GlobalDependencyProperty s_ModeProperty; + //static GlobalDependencyProperty s_ModeProperty; - static void EnsureProperties(); + //static void EnsureProperties(); - static void ClearProperties(); + //static void ClearProperties(); - static void OnModePropertyChanged( - winrt.DependencyObject & sender, + //static void OnModePropertyChanged( + // winrt.DependencyObject & sender, - winrt.DependencyPropertyChangedEventArgs & args); + //winrt.DependencyPropertyChangedEventArgs & args); } }