Skip to content

Commit

Permalink
[Proposal] Organize partial classes inside Controls (#13113)
Browse files Browse the repository at this point in the history
### Description of Change

- Move all related files into the same folder
- Move all the code inside ".impl.cs" into "<file>.Controls.cs"
- It doesn't seem like it's been useful to have these concepts
separated. We also already have some repeats with the name "<file>.cs"
because of platform specifics so I'm thinking that having the suffix
"controls.cs" which is related to all things bindable is useful
- Rename the file with the mappers to "Entry.Mapper.cs". It's annoying
having 3 things called `Entry.cs` now we'll just have 2 :-)

<img width="160" alt="image"
src="https://user-images.githubusercontent.com/5375137/216784012-f1ba6538-5cca-4e4e-9a79-6143540a27cd.png">


### Issues Fixed

Headaches and confusion
  • Loading branch information
PureWeen authored Feb 19, 2023
2 parents bf7f3df + 3622906 commit 8d705e8
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Microsoft.Maui.Controls
/// <summary>
/// Entry is a single line text entry. It is best used for collecting small discrete pieces of information, like usernames and passwords.
/// </summary>
public partial class Entry : InputView, IFontElement, ITextAlignmentElement, IEntryController, IElementConfiguration<Entry>
public partial class Entry : InputView, IFontElement, ITextAlignmentElement, IEntryController, IElementConfiguration<Entry>, IEntry
{
/// <summary>
/// Backing store for the <see cref="ReturnType"/> property.
Expand Down Expand Up @@ -299,5 +299,12 @@ public IPlatformElementConfiguration<T, Entry> On<T>() where T : IConfigPlatform
void ITextAlignmentElement.OnHorizontalTextAlignmentPropertyChanged(TextAlignment oldValue, TextAlignment newValue)
{
}

Font ITextStyle.Font => this.ToFont();

void IEntry.Completed()
{
(this as IEntryController).SendCompleted();
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 0 additions & 13 deletions src/Controls/src/Core/HandlerImpl/Entry/Entry.Impl.cs

This file was deleted.

0 comments on commit 8d705e8

Please sign in to comment.