Skip to content
New issue

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

Alignment Center not possible? #1121

Open
2 of 4 tasks
SonOfKorriban opened this issue Jul 24, 2021 · 2 comments
Open
2 of 4 tasks

Alignment Center not possible? #1121

SonOfKorriban opened this issue Jul 24, 2021 · 2 comments
Labels
Pri3 Low priority support-request Support-style question;customer needs help solving a problem [org][type][category]

Comments

@SonOfKorriban
Copy link

Servus,

i tried to Center this control horizontally AND vertically. Both are not working, because both properties are using the Top Left Corner of the Control. So if i write:
HorizontalAlignment="Center" and VerticalAlignment="Center"
the top left corner of the control is in the mid of my Window.

Is there any solution for this? Why there is this behaviour?

.NET or .NET Framework

Check the .NET target framework(s) being used, and include the version number(s). Put an x between the [ ] to check it.

  • .NET (5 or Core)
  • .NET Framework

Technology

Check the .NET target framework(s) being used, and include the version number(s). Put an x between the [ ] to check it.

  • WPF
  • Windows Forms
@PRMerger13 PRMerger13 added the Pri3 Low priority label Jul 24, 2021
@dotnet-bot dotnet-bot added the ⌚ Not Triaged Not triaged label Jul 24, 2021
@adegeo adegeo added needs-more-info Needs more info from OP. Auto-closed after 2 weeks if no response. [org][resolution] support-request Support-style question;customer needs help solving a problem [org][type][category] labels Jul 30, 2021
@adegeo
Copy link
Contributor

adegeo commented Jul 30, 2021

@SonOfKorriban sorry for the delay in response. When issues like this aren't tied to documentation, you'll generally get a quicker response searching and asking on StackOverflow.

Positioning and stretching is based on the container of your control. You'll need to supply some more xaml for me to understand the structure of your window.

@adegeo adegeo removed the ⌚ Not Triaged Not triaged label Jul 30, 2021
@SonOfKorriban
Copy link
Author

@SonOfKorriban sorry for the delay in response. When issues like this aren't tied to documentation, you'll generally get a quicker response searching and asking on StackOverflow.

Positioning and stretching is based on the container of your control. You'll need to supply some more xaml for me to understand the structure of your window.

Thank you for responding and no problem:
i have got an class named OutlineTextControl, inherited from FrameworkElement. (I copied your code basically)
Then, i've got a Window, where i use this Control in following way:

<Window>
  <Grid>
    <Grid>
       <Grid Panel.ZIndex="5">
         <Grid.RowDefinitions>
                    <RowDefinition Height="4*"/>
                    <RowDefinition Height="2*"/>
                    <RowDefinition Height="1*"/>
                    <RowDefinition Height="4*"/>
                </Grid.RowDefinitions>
                <kuatxamlextentions:OutlineTextControl  Font="Aurebesh" Fill="Black" Text="Hello There" Highlight="False" 
                   Grid.Row="2" HorizontalAlignment="Center"  Stroke="White" Panel.ZIndex="6" StrokeThickness="1" 
                   RenderTransformOrigin="10.5,10.5"/>

There is no difference, if i use the control inside a canvas, or a grid. The result is always the same: If i try to Center it horizontally, it only centers the Top Left corner of the Control.

@no-response no-response bot removed the needs-more-info Needs more info from OP. Auto-closed after 2 weeks if no response. [org][resolution] label Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pri3 Low priority support-request Support-style question;customer needs help solving a problem [org][type][category]
Projects
None yet
Development

No branches or pull requests

4 participants