2

I'm having a problem when changing a flow direction in a usercontrol by code, it changes all controls flowdirection.

How do i avoid some of thouse controls of changing flowdirection, maintaining allways LTR flowdirection.

Best Regards

asked May 9, 2014 at 10:28
1
  • 1
    As is customary (almost obligatory) on this website, please provide a small working code example that demonstrates your problem. Had you done that originally, then you would most likely have had a solution or two provided for you by now. Commented May 9, 2014 at 13:43

1 Answer 1

2

You can declare default style in your resource for each and every control, so that it gets applied to respective control by default in you user control.

the xaml code is:

<Window.Resources>
 <Style x:Key="TextBoxTemplate" TargetType="{x:Type TextBox}">
 <Setter Property="FlowDirection" Value="RightToLeft"/>
 </Style>
</Window.Resources>

the code behind is:

 public void Init_Style()
 {
 Style style = this.FindResource("TextBoxTemplate") as Style;
 textBox1.Style = style;
 }

In this way you can avoid changes of all controls flow direction.

answered Sep 15, 2014 at 8:26
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.