We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not sure if this is a bug or by design, but the TextAlignment enumeration used by TextBlock contains the duplicate entries.
Using Enum.GetValues shows there are 7 entries in total.
There are 2 entries labelled Left and 2 entries Labelled Right.
Screen capture below lists all entries.
See attached code.
Use Enum.GetValues to retrieve and display TextAlignment members.
Entries should have unique names in order to distinguish between the entry's behavior.
This is the list showing the duplicate names:
This is a breakpoint in the code showing duplicates. Note that the entry "Right" shows up as "End", but is still duplicated.
Windows App SDK 1.6.0: 1.6.240829007
Packaged (MSIX)
Windows 10 version 22H2 (19045, 2022 Update)
Visual Studio 2022
MainWindow.xaml
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> <TextBlock Name="TextBlockMain"></TextBlock> <ListView Name="ListViewMain"></ListView> </StackPanel>
MainWindow.xaml.cs public sealed partial class MainWindow : Window { public MainWindow() { this.InitializeComponent();
DisplayTextAlignment(); } private void DisplayTextAlignment() { int iIdx; int iCount; Array arTextAlignment; ListViewItem listViewItem; // Get array of enums arTextAlignment = Enum.GetValues(typeof(TextAlignment)); iCount = arTextAlignment.Length; for (iIdx = 0; iIdx < iCount; ++iIdx) { listViewItem = new ListViewItem { Content = arTextAlignment.GetValue(iIdx).ToString(), }; ListViewMain.Items.Add(listViewItem); } }
Attaching project TextBlockAlignment.zip
The text was updated successfully, but these errors were encountered:
manodasanW
No branches or pull requests
Describe the bug
Not sure if this is a bug or by design, but the TextAlignment enumeration used by TextBlock contains the duplicate entries.
Using Enum.GetValues shows there are 7 entries in total.
There are 2 entries labelled Left and 2 entries Labelled Right.
Screen capture below lists all entries.
Steps to reproduce the bug
See attached code.
Use Enum.GetValues to retrieve and display TextAlignment members.
Expected behavior
Entries should have unique names in order to distinguish between the entry's behavior.
Screenshots
This is the list showing the duplicate names:
This is a breakpoint in the code showing duplicates.
Note that the entry "Right" shows up as "End", but is still duplicated.
NuGet package version
Windows App SDK 1.6.0: 1.6.240829007
Packaging type
Packaged (MSIX)
Windows version
Windows 10 version 22H2 (19045, 2022 Update)
IDE
Visual Studio 2022
Additional context
MainWindow.xaml
MainWindow.xaml.cs
public sealed partial class MainWindow : Window
{
public MainWindow()
{
this.InitializeComponent();
Attaching project
TextBlockAlignment.zip
The text was updated successfully, but these errors were encountered: