小编Chr*_*col的帖子

Scrollviewer中的错误装配器

我正在努力确保我的错误装饰器不会被我的滚动查看器限制.我有一系列文本框位于固定宽度滚动查看器的边缘(没有水平滚动,只有垂直).然后,我有标记文本框错误的装饰者.

问题是装饰者被剪裁在滚动查看器的边缘.

有任何想法吗?

*注意:我已尝试将所有内容包装在AdornerDecorator中.

wpf adorner adornerdecorator adornerlayer

5
推荐指数
1
解决办法
1997
查看次数

UserControl上绑定依赖属性的问题

我有两个userControls(IconUserControl和DisplayUserControl),我遇到了绑定依赖项属性的问题,这里有一些细节:

  • IconUserControl有一个IsDisplayShown的bool DP
  • DisplayUserControl具有IsDisplayShown的bool DP

在XAML中我有:

<local:DisplayUserControl
                    x:Name="DisplayUserControl"
                    IsDisplayShown="{Binding ElementName=IconUserControl, Path=IsDisplayShown, Converter={StaticResource DummyConverter}}" />

<local:IconUserControl
                    x:Name="IconUserControl" />
Run Code Online (Sandbox Code Playgroud)

当IconUserControl.IsDisplayShown设置为true时,我可以在DummyConverter中看到这个值被传递,但它从不设置DisplayUserControl.IsDisplayShown.

但是,如果在View I设置的代码隐藏中DisplayUserControl.IsDisplayShown = true;,那么它可以正常工作.

我有两个UserControls的DataContext在构造函数中设置为"this".我试图摆弄绑定的"模式"属性.

*注意:DummyConverter只返回值,我只有这个确认Binding正在尝试工作.

我究竟做错了什么?

编辑:

这是两个DP:

public bool IsDisplayShown
        {
            get { return (bool)GetValue(IsDisplayShownProperty); }
            set { SetValue(IsDisplayShownProperty, value); }
        }
        public static readonly DependencyProperty IsDisplayShownProperty =
            DependencyProperty.Register("IsDisplayShown", typeof(bool), typeof(IconUserControl), new UIPropertyMetadata(false));

public bool IsDisplayShown
        {
            get { return (bool)GetValue(IsDisplayShownProperty); }
            set
            {
                if (value)
                    ShowOpenItems();
                else
                    HideOpenItems();
                SetValue(IsDisplayShownProperty, value);
            }
        }
        public static readonly DependencyProperty IsDisplayShownProperty= …
Run Code Online (Sandbox Code Playgroud)

wpf xaml binding dependency-properties

4
推荐指数
1
解决办法
2123
查看次数

WPF中的VisualTreeHelper.HitTest问题

我正试图在Canvas上测试一堆UserControls.我不希望HitTest()在整个可视树中走路,所以我使用FilterCallback来确保我只测试UserControl.

我的问题是UserControl永远不会命中,它应该,但它不会.如果我使用FilterCallback,我会返回它什么都没有.如果我让HitTest运行可视树,它会跳过UserControl.

这是一些代码:

<Canvas x:Name="Container">
<UserControl>
   <Grid>
      <Rectangle />
   </Grid>
</UserControl>
<UserControl>
   <Grid>
      <Rectangle />
   </Grid>
</UserControl>
</Canvas>

...
VisualTreeHelper.HitTest(Container, OnFilter, OnResult, myPoint);
...

private void OnResult(DependencyObject o)
{
   //I'll get the Rectangle here, but never the userControl  
}

private void OnFilter(DependencyObject o)
{
   //I will get the UserControl here, but even when I do nothing more than continue, it will not trigger a visualHit.  But the child rectangle will.
}
Run Code Online (Sandbox Code Playgroud)

wpf visualtreehelper hittest

4
推荐指数
1
解决办法
8883
查看次数

强制从代码中关闭所有打开的弹出窗口

我想让所有打开的弹出窗口(使用StaysOpen == false)从代码中关闭.基本上我想模拟用户从代码中单击鼠标(这将关闭弹出窗口).

我不需要实际模拟点击,我只需要产生的行为.我想过只是通过视觉树寻找弹出窗口并关闭每个弹出窗口,但这似乎不是最干净的方法.

提前感谢任何帮助或意见.

c# wpf xaml

4
推荐指数
1
解决办法
3085
查看次数

WPF中的实际可见性

在WPF中,元素可以具有"可见"的可见性,但在屏幕上实际上不可见,因为它的父级(或父级的父级)具有"可见性".

我希望能够知道元素是否实际在屏幕上呈现,而不必遍历可视树检查父项.

有谁知道这样做的方法?

提前致谢!

wpf visibility visual-tree

4
推荐指数
1
解决办法
891
查看次数

Lite Content Slider不推荐使用event.layerX和event.layerY

看来我的JQuery Lite内容滑块有问题.当我尝试移动到下一张幻灯片时,我收到警告.我不完全相信这是问题,因为它只是一个警告,但我看不到脚本的任何其他问题.

该网站是skincarewithaconscience.com

任何帮助或建议将不胜感激.

UPDATE

我正在使用jQuery 1.7.1并且Lite内容滑块中使用了noConflict模式.对不起我应该提到这两点.

wordpress jquery slider

3
推荐指数
2
解决办法
370
查看次数