为什么我的可见性绑定不起作用?

编程入门 行业动态 更新时间:2024-10-21 17:23:37
本文介绍了为什么我的可见性绑定不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我的一个可见性绑定有问题。 在我的应用程序中,我有一个文本框和一个组合框几乎在同一个地方。 它们是重叠的,所以我在背景中有两个变量用于它们的可见性。它们位于Datagrid中,因此可以从列表中提供Visibility Source。 我的Combobox的绑定工作得非常好,但是我的Textbox之一没有' t b / b 这是我的代码:

Hello everyone, I have a problem with one of my Visibility Bindings. In my application I have a Textbox and a combobox at nearly the same place. They are overlapping so I have two Variables in the background for their Visibility. They are in a Datagrid, so the Visibility Source will be provided from the list. The Binding of my Combobox works absolutely fine, but the one of my Textbox doesn't Here is my Code:

<TextBox x:Name="Textvalue" HorizontalAlignment="Left" VerticalAlignment="Center" Width="150" BorderBrush="#FF383F55" BorderThickness="0" Foreground="White" removed="#FF232734" Text="{Binding Path=Value, UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding Path=IsPath}"/> <ComboBox x:Name="Combobox" VerticalAlignment="Center" Foreground="White" Margin="3,3,3,3" Height="23" ItemsSource="{Binding Path=ValueArray}" SelectedValue="{Binding Path=Value, UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource ComboBoxStyle1}" Visibility="{Binding Path=IsCombobox}"/>

T hese是我的Get属性(两者都只有Get Proberty):

These are my Get Property for both (Both only have the Get Proberty):

public System.Windows.Visibility isPath { get { return _IsPath; } }

public System.Windows.Visibility IsCombobox { get { return _IsCombobox; } }

我希望你能帮助我,因为我不知道这里有什么问题:/ 提前致谢 我的尝试: 尝试将绑定更改为其他变量。

I hope you can help me because I don't know what's wrong here :/ Thanks in advance What I have tried: Tried to change the binding to a different Variable.

推荐答案

请检查外壳..代码Path = IsPath,但您的Property = isPath Please check the casing.. in code "Path=IsPath", but your Property = isPath

更多推荐

为什么我的可见性绑定不起作用?

本文发布于:2023-11-11 18:14:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1579200.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:绑定   不起作用   见性

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!