ControlTemplate
の値をコントロールに渡すことに大きな問題があります。 TextBox
はControlTemplate
ですが、このテンプレートの値をTextBox
テキストに渡すにはどうすればよいですか?TextBox with ControlTemplate - プロパティの問題Text
答えて
あなたが必要とするのは、名前がPART_ContentHost
のコンテナです。
ここでは、テキストボックスのコントロールテンプレートを作成する方法の完全な例を示します:TextBox Styles and Templates。この場合、テキストボックスはScrollViewer
の内部に表示されます。
希望すると助かります!
私が本当にあなたの問題を理解したら、カスタムテキストボックスコントロールにテキストボックスのテキスト値を表示します。 だから、これを行うためには、テンプレートなどにTemplate-Binding
を使用する必要があります。
<CustomControl Text="{TemplateBinding Text}">
CustomControl
は、テンプレートで使用するすべてのコントロールを参照してください。実際に私がやりたいことは、ControlTemplateの値をTextBoxに戻すことです。 – torpederos
私の問題の解決策が見つかりました。 ControlTemplateのコントロールにアクセスするには、コントロールに関連付けられたテンプレートで "FindName"メソッドを呼び出すことができます。 – torpederos
- 1. TextBoxテンプレートパディングの問題
- 2. ControlTemplateとDataTrigger Vs. DataTemplate with DataTemplateSelector
- 3. WPFのTextBoxフォーカスの問題
- 4. wpf validation rules with textbox
- 5. UWP TextBoxテキストオリエンテーションの問題
- 6. .NET TextBox BackColorの問題
- 7. Fabricjs i-textクローンの問題
- 8. QInputDialog with Multiline text
- 9. 問題Withステートメント
- 10. TabControl Editor(TextBox) - TreeView問題
- 11. Ruby gem with text comparison
- 12. oAuth with Scribe with LinkedIn - アクセストークンの問題
- 13. progressIndicator with Manipulate問題
- 14. 問題 "EXC_BAD_ACCESS with" removeFromSuperView
- 15. 複数行の問題WPFのTextBoxの
- 16. TextBoxのTextプロパティがDropDownのSelectedIndexChangedイベント内から更新されない
- 17. 派生TextBoxコントロールのWPFパフォーマンスの問題
- 18. clipsToBounds with CGAffineTransformRotateの問題
- 19. Twilio with Parse Serverの問題
- 20. with android ndk-gdbの問題
- 21. Aurelia class.bind with checked.bindの問題
- 22. facebookLogin.logInWithReadPermissions with Firebaseの問題
- 23. applicationShouldTerminate with iPhoneの問題
- 24. TDD with Xmlデータソースの問題
- 25. Azure with SSLの問題
- 26. Youtube Thumb with duration text overlay
- 27. merge facebook profile with text and image
- 28. WPF UIElement Inline with Text "Adornments"
- 29. Android - Gridview with Icon and text
- 30. Try-Catch Block Issue with Text
私は私の問題を解決しました。私がしなければならないことはTwoWayバインディングを使うことです。皆、ありがとうございました。 – torpederos