Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -1712,5 +1712,5 @@ protected override void Dispose(bool disposing)
}
}

internal class UpdateToolBarButtonsMessage { }
internal sealed record UpdateToolBarButtonsMessage { }
}
2 changes: 1 addition & 1 deletion src/Controls/src/Core/HandlerImpl/Page.Impl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ internal NavigatedFromEventArgs(Page destinationPage)
internal Page DestinationPage { get; }
}

public class CloseContextActionsMessage { }
public sealed record CloseContextActionsMessage { }
}
9 changes: 9 additions & 0 deletions src/Controls/src/Core/IsExternalInit.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// https://docs.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.isexternalinit?view=net-5.0
// https://developercommunity.visualstudio.com/t/error-cs0518-predefined-type-systemruntimecompiler/1244809
// Adding this because at least one of the target frameworks doesn't include it; hopefully we can drop this at some point
// (and hopefully before release)
// TODO ezhart Evaluate whether we still need this
namespace System.Runtime.CompilerServices
{
internal static class IsExternalInit { }
}
51 changes: 6 additions & 45 deletions src/Controls/src/Core/Page.cs
Original file line number Diff line number Diff line change
Expand Up @@ -576,51 +576,12 @@ internal void SetTitleView(View oldTitleView, View newTitleView)
}

// TODO ezhart These Pages could probably all be IView
public class PageBusyMessage
{
public PageBusyMessage(Page page, bool isBusy)
{
Page = page;
IsBusy = isBusy;
}

public Page Page { get; set; }
public bool IsBusy { get; set; }
}

public class PageAlertMessage
{
public PageAlertMessage(Page page, AlertArguments arguments)
{
Page = page;
Arguments = arguments;
}

public Page Page { get; set; }
public AlertArguments Arguments { get; set; }
}
public sealed record PageBusyMessage(Page Page, bool IsBusy);

public class PromptMessage
{
public PromptMessage(Page page, PromptArguments arguments)
{
Page = page;
Arguments = arguments;
}
public sealed record PageAlertMessage(Page Page, AlertArguments Arguments);

public Page Page { get; set; }
public PromptArguments Arguments { get; set; }
}

public class ActionSheetMessage
{
public ActionSheetMessage(Page page, ActionSheetArguments arguments)
{
Page = page;
Arguments = arguments;
}

public Page Page { get; set; }
public ActionSheetArguments Arguments { get; set; }
}
public sealed record PromptMessage(Page Page, PromptArguments Arguments);

public sealed record ActionSheetMessage(Page Page, ActionSheetArguments Arguments);
}

2 changes: 1 addition & 1 deletion src/Controls/src/Core/RadioButtonGroupController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void SetSelectedValue(object radioButtonValue)

if (radioButtonValue != null)
{
WeakReferenceMessenger.Default.Send(new RadioButtonGroupValueChanged(_groupName, RadioButtonGroup.GetVisualRoot(_layout), radioButtonValue));
WeakReferenceMessenger.Default.Send(new RadioButtonGroupValueChanged(RadioButtonGroup.GetVisualRoot(_layout), radioButtonValue, _groupName));
}
}

Expand Down
51 changes: 0 additions & 51 deletions src/Controls/src/Core/RadioButtonGroupSelectionChanged.cs

This file was deleted.

16 changes: 16 additions & 0 deletions src/Controls/src/Core/RadioButtonMessages.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace Microsoft.Maui.Controls
{
internal abstract record RadioButtonScopeMessage(Element Scope);

internal sealed record RadioButtonGroupSelectionChanged(Element Scope, RadioButton RadioButton)
: RadioButtonScopeMessage(Scope);

internal sealed record RadioButtonGroupNameChanged(Element Scope, string OldName)
: RadioButtonScopeMessage(Scope);

internal sealed record RadioButtonValueChanged(Element Scope, RadioButton RadioButton)
: RadioButtonScopeMessage(Scope);

internal sealed record RadioButtonGroupValueChanged (Element Scope, object Value, string GroupName)
: RadioButtonScopeMessage(Scope);
}