Skip to content

Commit

Permalink
Merge pull request #12227 from Youssef1313/misc-breaking-changes
Browse files Browse the repository at this point in the history
Misc breaking changes
  • Loading branch information
Youssef1313 authored May 11, 2023
2 parents 9bf8a8a + 80430be commit d7f2cd1
Show file tree
Hide file tree
Showing 32 changed files with 445 additions and 331 deletions.
151 changes: 150 additions & 1 deletion build/PackageDiffIgnore.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Uno.UI.Composition/Composition/KeyFrameAnimation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal KeyFrameAnimation(Compositor compositor) : base(compositor)

public global::System.TimeSpan DelayTime { get; set; }

public int KeyFrameCount { get; set; }
public int KeyFrameCount { get; }

public AnimationDirection Direction { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions src/Uno.UI/Extensions/ViewExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ internal static string GetTransformDetails(this Transform transform)
{
string GetMatrix(MatrixTransform matrix)
{
var m = matrix.Matrix.Inner;
return $" Matrix=[{m.M11}, {m.M21}, {m.M31}, {m.M12}, {m.M22}, {m.M32}]";
var m = matrix.Matrix;
return $" Matrix=[{m.M11}, {m.M21}, {m.OffsetX}, {m.M12}, {m.M22}, {m.OffsetY}]";
}

return transform switch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,8 @@ public partial class NavigationView : global::Windows.UI.Xaml.Controls.ContentC
// Forced skipping of method Windows.UI.Xaml.Controls.NavigationView.MenuItemContainerStyle.set
// Forced skipping of method Windows.UI.Xaml.Controls.NavigationView.MenuItemContainerStyleSelector.get
// Forced skipping of method Windows.UI.Xaml.Controls.NavigationView.MenuItemContainerStyleSelector.set
#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "IS_UNIT_TESTS", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public object MenuItemFromContainer( global::Windows.UI.Xaml.DependencyObject container)
{
throw new global::System.NotImplementedException("The member object NavigationView.MenuItemFromContainer(DependencyObject container) is not implemented. For more information, visit https://aka.platform.uno/notimplemented?m=object%20NavigationView.MenuItemFromContainer%28DependencyObject%20container%29");
}
#endif
#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "IS_UNIT_TESTS", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public global::Windows.UI.Xaml.DependencyObject ContainerFromMenuItem( object item)
{
throw new global::System.NotImplementedException("The member DependencyObject NavigationView.ContainerFromMenuItem(object item) is not implemented. For more information, visit https://aka.platform.uno/notimplemented?m=DependencyObject%20NavigationView.ContainerFromMenuItem%28object%20item%29");
}
#endif
// Skipping already declared method Windows.UI.Xaml.Controls.NavigationView.MenuItemFromContainer(Windows.UI.Xaml.DependencyObject)
// Skipping already declared method Windows.UI.Xaml.Controls.NavigationView.ContainerFromMenuItem(object)
// Forced skipping of method Windows.UI.Xaml.Controls.NavigationView.SelectionChanged.add
// Forced skipping of method Windows.UI.Xaml.Controls.NavigationView.SelectionChanged.remove
// Forced skipping of method Windows.UI.Xaml.Controls.NavigationView.ItemInvoked.add
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ public string PaneTitle
/// <summary>
/// Identifies the PaneTitle dependency property.
/// </summary>
public static readonly DependencyProperty PaneTitleProperty =
public static DependencyProperty PaneTitleProperty { get; } =
DependencyProperty.Register(nameof(PaneTitle), typeof(string), typeof(NavigationView), new FrameworkPropertyMetadata(string.Empty, OnPropertyChanged)); //TODO: Empty string or null?

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public Windows.UI.Xaml.Controls.IAnimatedVisualSource DeterminateSource
set { SetValue(DeterminateSourceProperty, value); }
}

public static readonly DependencyProperty DeterminateSourceProperty =
public static DependencyProperty DeterminateSourceProperty { get; } =
DependencyProperty.Register("DeterminateSource", typeof(Windows.UI.Xaml.Controls.IAnimatedVisualSource), typeof(ProgressRing), new FrameworkPropertyMetadata(null, (s, e) => (s as ProgressRing)?.OnDeterminateSourcePropertyChanged(e)));


Expand All @@ -100,7 +100,7 @@ public Windows.UI.Xaml.Controls.IAnimatedVisualSource IndeterminateSource
set { SetValue(IndeterminateSourceProperty, value); }
}

public static readonly DependencyProperty IndeterminateSourceProperty =
public static DependencyProperty IndeterminateSourceProperty { get; } =
DependencyProperty.Register("IndeterminateSource", typeof(Windows.UI.Xaml.Controls.IAnimatedVisualSource), typeof(ProgressRing), new FrameworkPropertyMetadata(null, (s, e) => (s as ProgressRing)?.OnIndeterminateSourcePropertyChanged(e)));

public ProgressRing()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public double ColumnSpacing
set => SetValue(ColumnSpacingProperty, value);
}

public static readonly DependencyProperty ColumnSpacingProperty =
public static DependencyProperty ColumnSpacingProperty { get; } =
DependencyProperty.Register(nameof(ColumnSpacing), typeof(double), typeof(ColumnMajorUniformToLargestGridLayout), new FrameworkPropertyMetadata(default(double), OnColumnSpacingPropertyChanged));

public int MaxColumns
Expand All @@ -19,7 +19,7 @@ public int MaxColumns
set => SetValue(MaxColumnsProperty, value);
}

public static readonly DependencyProperty MaxColumnsProperty =
public static DependencyProperty MaxColumnsProperty { get; } =
DependencyProperty.Register(nameof(MaxColumns), typeof(int), typeof(ColumnMajorUniformToLargestGridLayout), new FrameworkPropertyMetadata(default(int), OnMaxColumnsPropertyChanged));

public double RowSpacing
Expand All @@ -28,7 +28,7 @@ public double RowSpacing
set => SetValue(RowSpacingProperty, value);
}

public static readonly DependencyProperty RowSpacingProperty =
public static DependencyProperty RowSpacingProperty { get; } =
DependencyProperty.Register(nameof(RowSpacing), typeof(double), typeof(ColumnMajorUniformToLargestGridLayout), new FrameworkPropertyMetadata(default(double), OnRowSpacingPropertyChanged));

private static void OnColumnSpacingPropertyChanged(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public partial class RadioMenuFlyoutItem
public static bool GetAreCheckStatesEnabled(DependencyObject obj) => (bool)obj.GetValue(AreCheckStatesEnabledProperty);
public static void SetAreCheckStatesEnabled(DependencyObject obj, bool value) => obj.SetValue(AreCheckStatesEnabledProperty, value);

public static readonly DependencyProperty AreCheckStatesEnabledProperty =
public static DependencyProperty AreCheckStatesEnabledProperty { get; } =
DependencyProperty.RegisterAttached("AreCheckStatesEnabled", typeof(bool), typeof(RadioMenuFlyoutItem), new FrameworkPropertyMetadata(false, OnAreCheckStatesEnabledPropertyChanged));

public string GroupName
Expand All @@ -20,7 +20,7 @@ public string GroupName
set { SetValue(GroupNameProperty, value); }
}

public static readonly DependencyProperty GroupNameProperty =
public static DependencyProperty GroupNameProperty { get; } =
DependencyProperty.Register(nameof(GroupName), typeof(string), typeof(RadioMenuFlyoutItem), new FrameworkPropertyMetadata(string.Empty, (s, e) => (s as RadioMenuFlyoutItem)?.OnPropertyChanged(e)));

public new bool IsChecked
Expand All @@ -29,7 +29,7 @@ public string GroupName
set { SetValue(IsCheckedProperty, value); }
}

public static new readonly DependencyProperty IsCheckedProperty =
public static new DependencyProperty IsCheckedProperty { get; } =
DependencyProperty.Register(nameof(IsChecked), typeof(bool), typeof(RadioMenuFlyoutItem), new FrameworkPropertyMetadata(false, (s, e) => (s as RadioMenuFlyoutItem)?.OnPropertyChanged(e)));
}
}
6 changes: 2 additions & 4 deletions src/Uno.UI/UI/Xaml/Controls/NavigationView/NavigationView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1652,8 +1652,7 @@ bool BumperNavigation(int offset)
return false;
}

#if false
object MenuItemFromContainer(DependencyObject container)
public object MenuItemFromContainer(DependencyObject container)
{
var nvi = container;
if (nvi != null)
Expand Down Expand Up @@ -1693,7 +1692,7 @@ object MenuItemFromContainer(DependencyObject container)
return null;
}

DependencyObject ContainerFromMenuItem(object item)
public DependencyObject ContainerFromMenuItem(object item)
{
var data = item;
if (data != null)
Expand All @@ -1703,7 +1702,6 @@ DependencyObject ContainerFromMenuItem(object item)

return null;
}
#endif

void OnTopNavDataSourceChanged(NotifyCollectionChangedEventArgs args)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Windows.UI.Xaml.Controls.Primitives
{
public abstract partial class ButtonBase : ContentControl
public partial class ButtonBase : ContentControl
{
private readonly SerialDisposable _clickSubscription = new SerialDisposable();

Expand Down Expand Up @@ -62,7 +62,7 @@ void clickHandler(object e, EventArgs s)

//
// Bind the enabled handler
//
//
void enabledHandler(object e, DependencyPropertyChangedEventArgs s)
{
uiControl.Enabled = IsEnabled;
Expand Down
4 changes: 2 additions & 2 deletions src/Uno.UI/UI/Xaml/Controls/Primitives/GeneratorPosition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ public partial struct GeneratorPosition
{
public GeneratorPosition(int index, int offset) { throw new NotImplementedException(); }

public int Index { get; set; }
public int Index;

public int Offset { get; set; }
public int Offset;

public override bool Equals(object o) { throw new NotImplementedException(); }

Expand Down
8 changes: 4 additions & 4 deletions src/Uno.UI/UI/Xaml/Controls/ScrollBarVisibility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ namespace Windows.UI.Xaml.Controls
public enum ScrollBarVisibility
{
/// <summary>
/// Enables the scrollbars if the content is greater than the view port.
/// Disables scrolling.
/// </summary>
Auto,
Disabled,

/// <summary>
/// Disables scrolling.
/// Enables the scrollbars if the content is greater than the view port.
/// </summary>
Disabled,
Auto,

/// <summary>
/// Enables scrolling, but the scrollbars are not visible.
Expand Down
6 changes: 3 additions & 3 deletions src/Uno.UI/UI/Xaml/Controls/TextWrapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ namespace Windows.UI.Xaml
{
public enum TextWrapping
{
NoWrap,
Wrap,
WrapWholeWords,
NoWrap = 1,
Wrap = 2,
WrapWholeWords = 3,
}
}
8 changes: 4 additions & 4 deletions src/Uno.UI/UI/Xaml/CornerRadius.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ public partial struct CornerRadius : IEquatable<CornerRadius>
{
/// <summary>Gets or sets the radius of the top-left corner.</summary>
/// <returns>The radius of the top-left corner. The default is 0.</returns>
public double TopLeft { get; set; }
public double TopLeft;

/// <summary>Gets or sets the radius of the top-right corner. </summary>
/// <returns>The radius of the top-right corner. The default is 0.</returns>
public double TopRight { get; set; }
public double TopRight;

/// <summary>Gets or sets the radius of the bottom-right corner. </summary>
/// <returns>The radius of the bottom-right corner. The default is 0.</returns>
public double BottomRight { get; set; }
public double BottomRight;

/// <summary>Gets or sets the radius of the bottom-left corner. </summary>
/// <returns>The radius of the bottom-left corner. The default is 0.</returns>
public double BottomLeft { get; set; }
public double BottomLeft;

public CornerRadius(double uniformRadius) : this()
{
Expand Down
6 changes: 3 additions & 3 deletions src/Uno.UI/UI/Xaml/Data/BindingMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ public enum BindingMode
/// <summary>
/// Updates the target property when the binding is created. Changes to the source object can also propagate to the target.
/// </summary>
OneWay,
OneWay = 1,
/// <summary>
/// Updates the target property when the binding is created.
/// </summary>
OneTime,
OneTime = 2,
/// <summary>
/// Updates either the target or the source object when either changes. When the binding is created, the target property is updated from the source.
/// </summary>
TwoWay,
TwoWay = 3,
}
}

2 changes: 1 addition & 1 deletion src/Uno.UI/UI/Xaml/DependencyPropertyChangedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Windows.UI.Xaml
/// <summary>
/// Describes the changes made to a dependency property
/// </summary>
public partial class DependencyPropertyChangedEventArgs : EventArgs
public sealed partial class DependencyPropertyChangedEventArgs : EventArgs
{
internal DependencyPropertyChangedEventArgs(
DependencyProperty property,
Expand Down
5 changes: 2 additions & 3 deletions src/Uno.UI/UI/Xaml/Duration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ public Duration(TimeSpan timeSpan)
TimeSpan = timeSpan;
}

public DurationType Type { get; private set; }

public TimeSpan TimeSpan { get; private set; }
public DurationType Type;
public TimeSpan TimeSpan;

public static implicit operator Duration(string timeSpan)
=> timeSpan != null ? new Duration(TimeSpan.Parse(timeSpan, CultureInfo.InvariantCulture)) : new Duration(TimeSpan.Zero);
Expand Down
5 changes: 2 additions & 3 deletions src/Uno.UI/UI/Xaml/GridLength.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@ public partial struct GridLength : IEquatable<GridLength>
{
public static GridLength Auto => GridLengthHelper.Auto;

public GridUnitType GridUnitType { get; private set; }
public GridUnitType GridUnitType;
public double Value;

public bool IsAbsolute { get { return GridUnitType == Xaml.GridUnitType.Pixel; } }

public bool IsAuto { get { return GridUnitType == Xaml.GridUnitType.Auto; } }

public bool IsStar { get { return GridUnitType == Xaml.GridUnitType.Star; } }

public double Value { get; private set; }

public static implicit operator GridLength(string value)
=> FromString(value);

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

namespace Windows.UI.Xaml.Media.Animation
{
public abstract partial class EasingFunctionBase
public partial class EasingFunctionBase
{
internal virtual ITimeInterpolator CreateTimeInterpolator()
{
Expand Down
12 changes: 6 additions & 6 deletions src/Uno.UI/UI/Xaml/Media/Animation/EntranceThemeTransition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,29 @@ public EntranceThemeTransition()

#region FromHorizontalOffset Property

public float FromHorizontalOffset
public double FromHorizontalOffset
{
get { return (float)this.GetValue(FromHorizontalOffsetProperty); }
get { return (double)this.GetValue(FromHorizontalOffsetProperty); }
set { this.SetValue(FromHorizontalOffsetProperty, value); }
}

// Using a DependencyProperty as the backing store for FromHorizontalOffset. This enables animation, styling, binding, etc...
public static DependencyProperty FromHorizontalOffsetProperty { get; } =
DependencyProperty.Register("FromHorizontalOffset", typeof(float), typeof(EntranceThemeTransition), new FrameworkPropertyMetadata(40f));
DependencyProperty.Register("FromHorizontalOffset", typeof(double), typeof(EntranceThemeTransition), new FrameworkPropertyMetadata(40f));

#endregion

#region FromVerticalOffset Property

public float FromVerticalOffset
public double FromVerticalOffset
{
get { return (float)this.GetValue(FromVerticalOffsetProperty); }
get { return (double)this.GetValue(FromVerticalOffsetProperty); }
set { this.SetValue(FromVerticalOffsetProperty, value); }
}

// Using a DependencyProperty as the backing store for FromVerticalOffset. This enables animation, styling, binding, etc...
public static DependencyProperty FromVerticalOffsetProperty { get; } =
DependencyProperty.Register("FromVerticalOffset", typeof(float), typeof(EntranceThemeTransition), new FrameworkPropertyMetadata(0f));
DependencyProperty.Register("FromVerticalOffset", typeof(double), typeof(EntranceThemeTransition), new FrameworkPropertyMetadata(0f));

#endregion

Expand Down
2 changes: 1 addition & 1 deletion src/Uno.UI/UI/Xaml/Media/Animation/KeyTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Windows.UI.Xaml.Media.Animation
{
public partial struct KeyTime : IEquatable<KeyTime>, IComparable<KeyTime>
{
public TimeSpan TimeSpan { get; private set; }
public TimeSpan TimeSpan;

public static KeyTime FromTimeSpan(TimeSpan timeSpan)
=> new KeyTime() { TimeSpan = timeSpan };
Expand Down
6 changes: 3 additions & 3 deletions src/Uno.UI/UI/Xaml/Media/Animation/RepeatBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ public RepeatBehavior(TimeSpan duration)
Count = 0;
}

public double Count { get; set; }
public double Count;

public TimeSpan Duration { get; set; }
public TimeSpan Duration;

public RepeatBehaviorType Type { get; set; }
public RepeatBehaviorType Type;

public bool HasCount => Type == RepeatBehaviorType.Count;

Expand Down
Loading

0 comments on commit d7f2cd1

Please sign in to comment.