标签: silverlight-toolkit

删除(折叠)LineSeries中的DataPoints?

我想从Silverlight图表中的LineSeries中删除数据点标记.我在网上找到的唯一方法是将VisibilityProperty设置为Collapse.

//不在当前的SL工具包版本中工作var collapseDataPointSetter = new Setter(Control.VisibilityProperty,Visibility.Collapsed);

但这不适用于当前版本的SL工具包.如何在当前版本中删除或隐藏DataPoint标记?

silverlight charts silverlight-toolkit

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

为什么Silverlight 4工具只提供部分智能感知?

我终于安装了Silverlight 4 Toolkit,在找到这个问题中描述的正确命名空间困难后引用并工作.

但智能感知不能完全发挥作用:在我输入" tk:"之后,它不会弹出我可用的各种控件,但是如果我输入一个控件名称,例如DockPanel,它就会起作用,如下所示.在输入tk:DropPanel后,它甚至会给我智能感知,这是奇怪的.

如何在所有情况下为Silverlight 4 Toolkit提供intellisense?

我可以想象我需要另一个命名空间,但这个网站说这个参考:

现在就是您所需要的(并且将由Visual Studio和Blend自动使用)

替代文字http://www.deviantsart.com/upload/q02bav.jpg

这是Silverlight 3 Toolkit intellisense的截图,它在vs2008和web dev express 2008中都运行良好:

替代文字http://www.deviantsart.com/upload/196ufid.jpg

silverlight silverlight-toolkit silverlight-4.0

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

Silverlight设计师未处理的异常

当我使用Silverlight 4(有或没有WCF RIA服务检查)创建一个新的Silverlight应用程序(C#,如果这很重要)并在设计器中打开MainPage.xaml时,我收到一个未处理的异常.堆栈在下面.这是一个未经修改的项目.

I have uninstalled all Silverlight and reinstalled the tools listed above. I the same error when I open the App.xaml file as well. When I compile it completes without error, however when I run the application it always comes up that Silverlight is not installed.

I have installed Visual Web Developer Express 2010 (v10.0.30319.1 RTMRel) and Silverlight Tools for VS2010 (v10.0.30319.332) on a 32bit Windows XP machine. The IDE works fine in other regards, only …

visual-web-developer silverlight-toolkit silverlight-4.0

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

Silverlight DataGrid行颜色绑定

我想找到一种方法将DataGrid的行的背景颜色绑定到绑定对象的属性.

这是我的XAML:

<sdk:DataGrid ItemsSource="{Binding MyItems}" />
Run Code Online (Sandbox Code Playgroud)

我正在使用Silverlight 4的MVVM Light Toolkit.

silverlight xaml datagrid silverlight-toolkit silverlight-4.0

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

在visual studio中的Windows Phone 7设计窗格中向下滚动

愚蠢的问题,但你如何在wp7设计窗格中向下滚动视觉工作室?

StackPanel在页面中有很多元素,设计窗格只显示符合wp屏幕的第一个元素.我无法找到向下滚动到其他元素的方法.

在附加的捕获中,您可以看到在"库存单位"之后它没有显示任何其他内容,尽管我之后有更多元素.

在此输入图像描述

silverlight-toolkit windows-phone-7 windows-phone-7.1

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

DataTemplate中的ContextMenu绑定问题

我在LongListSelector中有一个上下文菜单.此列表在运行时创建和更新.

<phone:PanoramaItem Header="{Binding Path=LocalizedResources.SavedGamesHeader, Source={StaticResource LocalizedStrings}}" Orientation="Horizontal">
            <phone:LongListSelector Margin="0,0,-22,2" ItemsSource="{Binding SavedGames}">
                <phone:LongListSelector.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Vertical" Margin="12,2,0,20" Width="432">
                            <toolkit:ContextMenuService.ContextMenu>
                                <toolkit:ContextMenu>
                                    <toolkit:MenuItem Header="Remove" Click="RemoveSave_OnClick"/>
                                </toolkit:ContextMenu>
                            </toolkit:ContextMenuService.ContextMenu>
                            <Image Margin="10,5,10,0"  Height="173" Width="248" Source="{Binding Screen}" Stretch="Fill" HorizontalAlignment="Left"></Image>
                            <StackPanel Width="311" Margin="8,5,0,0" HorizontalAlignment="Left">
                                <TextBlock Tap="Save_OnTap" Tag="{Binding SavedGame}" Text="{Binding SaveName}" TextWrapping="Wrap" Margin="10,0" Style="{StaticResource PhoneTextExtraLargeStyle}" FontSize="{StaticResource PhoneFontSizeMedium}" Foreground="White" FontWeight="Bold" FontFamily="Arial Black" HorizontalAlignment="Left" />
                                <TextBlock Text="{Binding GameName}" TextWrapping="Wrap" Margin="10,-2,10,0" Style="{StaticResource PhoneTextSubtleStyle}" HorizontalAlignment="Left" />
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                                    <TextBlock Text="Created on:" Margin="10,-2,10,0" Style="{StaticResource PhoneTextSubtleStyle}" />
                                    <TextBlock Text="{Binding Created}" TextWrapping="Wrap" Margin="5,-2,10,0" Style="{StaticResource PhoneTextSubtleStyle}" …
Run Code Online (Sandbox Code Playgroud)

c# silverlight-toolkit silverlight-4.0 windows-phone-8

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

如何在Silverlight Toolkit中停止处理Flick Gesture事件的WP7枢轴控件

我的WP7应用程序中有一个Pivot Control,它本质上响应左右滑动以在枢轴项之间移动.

然后我想在UserControl(我页面上的一个小UI段)上使用Flick Gesture来获取其他内容.

我的用户控件确实处理了事件,但Pivot控件也是如此,因此它导航到下一个项目.我还没有想出如何在usercontrol处理事件时停止事件.

是否可以在WP7数据透视控件中使用带有轻弹手势的子控件?

例如:

        private void glBlinds_Flick(object sender, FlickGestureEventArgs e)
        {
                //do stuff
                e.Handled = true;
        }
Run Code Online (Sandbox Code Playgroud)

pivot silverlight-toolkit windows-phone-7

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

以编程方式添加WP7 ContextMenu

我正在动态地在页面上加载元素(读取XML文件的内容).动态内容被加载到StackPanel.内容的每个元素由一个TextBlock和另一个UI元素组成,因此对于每对我创建一个新的StackPanel,然后将其添加到父元素StackPanel.代码如下所示:

TextBlock header = new TextBlock() {
        Text = "Heading 1",
        HorizontalAlignment = HorizontalAlignment.Stretch,
        VerticalAlignment = VerticalAlignment.Top,
        Foreground = (SolidColorBrush)Application.Current.Resources["PhoneAccentBrush"],
      };
TextBox item = new TextBox() {
        HorizontalAlignment = HorizontalAlignment.Stretch,
        VerticalAlignment = VerticalAlignment.Top,
      };
StackPanel sp = new StackPanel();
sp.Children.Add( header );
sp.Children.Add( item );

parentSP.Children.Add( sp );
Run Code Online (Sandbox Code Playgroud)

我想将添加ContextMenu到这个StackPanel(spparentSP); 根据从文件中读取的一些参数,它可以是2个不同的上下文菜单之一.我尝试了以下但它不起作用:

    ContextMenu cm = new ContextMenu();
    RoutedEventHandler clickHandler = new RoutedEventHandler( OnContextMenuClicked );

    // Add …
Run Code Online (Sandbox Code Playgroud)

contextmenu silverlight-toolkit windows-phone-7

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

Silverlight 5 + AutoCompleteBox = Bug

刚刚安装了几天前发布的SL5和工具包.
将AutoCompleteBox的Text属性设置为string.Empty时会发生错误.它导致AutoCompleteBox处于错误状态.重现错误:

将AutoCompleteBox和Button添加到主页面.注册TextChanged和Click事件.这是代码隐藏:

public partial class MainPage : UserControl
{
    public MainPage()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, RoutedEventArgs e)
    {
        auto.Text = string.Empty;
    }

    private void auto_TextChanged(object sender, RoutedEventArgs e)
    {
        // Put a break point here.
    }
} 
Run Code Online (Sandbox Code Playgroud)

在运行时:

1)在自动装箱中输入"aa".

2)单击按钮.

3)键入"q".(仍调用TextChanged).

4)擦除"q" - 调用TextChanged .

5)再次输入"q" - 调用TextChanged .

6)依此类推,直到你选了一封新信.然后它重新开始.

autocomplete silverlight-toolkit autocompletebox silverlight-5.0

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

Windows Phone Toolkit上下文菜单项在删除项目然后添加项目时绑定了错误的对象

我刚刚遇到上下文菜单的一个严重问题,我几个小时都无法解决.

为了重现这个问题,我在Visual Studio 2012中使用Windows Phone 8的应用程序模板创建了一个全新的Panorama应用程序.我通过nugget安装了Windows Phone工具包,并在绑定到Items的第一个长列表选择器的数据模板中添加了上下文菜单

<StackPanel Margin="0,-6,0,12">
    <TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}" FontSize="{StaticResource PhoneFontSizeExtraLarge}"/>
    <toolkit:ContextMenuService.ContextMenu>
        <toolkit:ContextMenu>
            <toolkit:MenuItem Header="{Binding LineOne}" Click="MenuItem_Click_1" Tag="{Binding}">
            </toolkit:MenuItem>
        </toolkit:ContextMenu>
    </toolkit:ContextMenuService.ContextMenu>
</StackPanel>
Run Code Online (Sandbox Code Playgroud)

我将标题设置为LineOne属性以便于调试.我附上了以下事件:

private void MenuItem_Click_1(object sender, RoutedEventArgs e)
{
    var itemViewModel = (ItemViewModel)((MenuItem)sender).Tag;
    App.ViewModel.Items.Remove(itemViewModel);
    App.ViewModel.Items.Add(new ItemViewModel { LineOne = "Test", LineTwo = "Test", LineThree = "Test" });
}
Run Code Online (Sandbox Code Playgroud)

我运行应用程序并使用上下文菜单删除第一个项目.第一个项目消失,名为Test的新项目按预期显示在列表底部.如果我持有这个新项目,则菜单项被绑定到"runtime one"(已删除的项目).

这是我可以重现错误的最简单的代码,但在我的真实应用程序中,我有相同的问题,更有意义的代码用于在不同的方法甚至不同的页面中添加和删除.我有一个命令绑定,但由于数据绑定错误,命令在错误的视图模型中使用错误的参数运行.

知道为什么会这样吗?

silverlight silverlight-toolkit windows-phone

4
推荐指数
2
解决办法
1528
查看次数