有没有办法在silverlight 3中创建一个可调整大小的子窗口?任何指针都非常感谢.
我使用Silverlight 4工具包创建了Silverlight图表,即4月发布.
请考虑以下图表:
<Grid x:Name="LayoutRoot" Background="White">
<Charting:Chart Title="Chart to test" Name="MySuperChart">
<Charting:LineSeries x:Name="MyLineSeries" Title="Something" />
</Charting:Chart>
</Grid>
Run Code Online (Sandbox Code Playgroud)
到现在为止还挺好.我可以访问图表中的系列MySuperChart.Series[0]但是当我尝试引用MyLineSeries时,它似乎是空的.
图片http://i41.tinypic.com/9k4h7t.png
完整视图
我正在使用WPF工具包,我正在尝试渲染一个看起来像直方图的图形.特别是,我希望每列都与每个列相对应.列之间应该没有间隙.
创建列图时,您应用了许多组件.(参见下面的示例XAML).有没有人知道你是否可以在其中一个元素上设置属性,这些元素指的是列之间的空白宽度?
<charting:Chart Height="600" Width="Auto" HorizontalAlignment="Stretch" Name="MyChart"
Title="Column Graph" LegendTitle="Legend">
<charting:ColumnSeries
Name="theColumnSeries"
Title="Series A"
IndependentValueBinding="{Binding Path=Name}"
DependentValueBinding="{Binding Path=Population}"
Margin="0"
>
</charting:ColumnSeries>
<charting:Chart.Axes>
<charting:LinearAxis
Orientation="Y"
Minimum="200000"
Maximum="2500000"
ShowGridLines="True" />
<charting:CategoryAxis
Name="chartCategoryAxis"
/>
</charting:Chart.Axes>
</charting:Chart>
Run Code Online (Sandbox Code Playgroud) 有没有办法控制轻弹动作的阈值来打开/关闭切换开关,这样它就不会弄乱枢轴控制的导航?
我有一个非常奇怪的问题,我不知道如何调试它.(旁注:我讨厌创建GUI!无论如何...... :)
我一直在遵循本指南,在Silverlight上使用drag'n drop.现在,我感兴趣的是列表中的重新排序.
如果我完全按照网站上的例子,一切都很好.它按预期工作. 但是,当我尝试用其他东西替换元素时,我再也无法重新排序了?!
考虑以下XAML:
<toolkit:ListBoxDragDropTarget AllowDrop="True">
<ListBox Width="200" Height="500" x:Name="FromBox" DisplayMemberPath="Label">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</toolkit:ListBoxDragDropTarget>
Run Code Online (Sandbox Code Playgroud)
除了DisplayMemberPath(此处为"Label")之外,这与我正在阅读的文章相同.
在代码隐藏中,我现在执行以下操作:
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
FromBox.ItemsSource = GetElements();
}
public static ObservableCollection<Element> GetElements()
{
ObservableCollection<Element> Elements = new ObservableCollection<Element>();
var Label = new Label();
Label.Label = "Label me";
Elements.Add(Label);
var IntegerBox = new IntegerBox();
IntegerBox.Label = "Størrelsen på en gennemsnits svale:";
IntegerBox.Description = "cm";
Elements.Add(IntegerBox);
var TextBox = new TextBox();
TextBox.Label = "QTTextBox";
Elements.Add(TextBox); …Run Code Online (Sandbox Code Playgroud) 我正在为一个新项目尝试使用caliburn.micro框架,但我坚持使用绑定ListPicker(工具包中的那个).当我将控件更改为简单的DropDown时,一切都按预期工作.我假设DropDown工作正常,因为这里实现了默认约定:
AddElementConvention<Selector>(Selector.ItemsSourceProperty, "SelectedItem", "SelectionChanged")
.ApplyBinding = (viewModelType, path, property, element, convention) => {
if (!SetBinding(viewModelType, path, property, element, convention))
return false;
ConfigureSelectedItem(element, Selector.SelectedItemProperty,viewModelType, path);
ApplyItemTemplate((ItemsControl)element, property);
return true;
};
Run Code Online (Sandbox Code Playgroud)
ListPicker没有实现Selector,所以我试图在我的引导程序中添加一个自定义约定:
static void AddCustomConventions() {
AddElementConvention<ListPicker>(ListPicker.ItemsSourceProperty, "SelectedItem", "SelectionChanged")
.ApplyBinding = (viewModelType, path, property, element, convention) => {
ConventionManager.ConfigureSelectedItem(element, ListPicker.SelectedItemProperty,viewModelType, path);
return true;
};
}
Run Code Online (Sandbox Code Playgroud)
不幸的是,这不起作用.你能帮我吗?
c# silverlight-toolkit windows-phone-7 caliburn.micro listpicker
我在WPF项目中使用Silverlight Toolkit,我想在我可以指定的Y轴值的柱形图中添加一条红色虚线水平线.我已经修改了图表模板并成功添加了一行,但我不知道如何让行显示在我想要的y轴值以及如何让它在整个图表中展开.这是我到目前为止的图表图片:

这是我用来生成它的图表模板XAML代码:
<charting:Chart Name="chartUsageHours" Grid.Column="1" BorderThickness="0" Padding="0" Loaded="chartUsageHours_Loaded">
<charting:Chart.Template>
<ControlTemplate TargetType="{x:Type charting:Chart}">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<datavis:Title Content="{TemplateBinding Title}" Style="{TemplateBinding TitleStyle}" />
<chartingprimitives:EdgePanel Name="ChartArea" Style="{TemplateBinding ChartAreaStyle}" Grid.Row="1" Margin="0,0,0,0">
<Grid Panel.ZIndex="-1" Style="{TemplateBinding PlotAreaStyle}" />
<Border Panel.ZIndex="10" BorderBrush="#FF919191" BorderThickness="1, 0, 0, 1" />
<Grid Name="HoursThresholdContainer" Canvas.ZIndex="1" Background="Transparent">
<Grid Name="HoursThreshold">
<Line Name="Horizontal" HorizontalAlignment="Stretch" X1="0" Y1="100" X2="600" Y2="100" Stroke="Red" StrokeDashArray="4, 2"/>
</Grid>
</Grid>
</chartingprimitives:EdgePanel>
</Grid>
</Border>
</ControlTemplate>
</charting:Chart.Template>
<charting:Chart.Series> …Run Code Online (Sandbox Code Playgroud) 我有一个我无法弄清楚的巨大问题.假设我有五种不同的水果,我希望它们中的每一种都与某种颜色相关联.假设我有三个"篮子",其中包含零个或多个所述水果.
当我为我的三个篮子制作饼图时,每个楔子只是一些随机颜色,可由控件选择.我怎么说,在图表中做蓝莓蓝,bannanas黄色等?
我知道这是一个奇怪的问题,但我想不出更简单的描述方式.
我不在乎解决方案是在XAML还是代码中,只要它有效.
c# silverlight silverlight-toolkit silverlight-4.0 pie-chart
我正在尝试在我的应用程序中实现压缩缩放.我找到了这篇文章(在Silverlight中正确缩放 - 缩放),它可以很好地适用于一个图像.但问题是,我的图像在列表框内,如下面的XAML所示:
<ListBox x:Name="lstImage" Margin="-20,-23,-12,32" Height="709" Width="480">
<ListBox.ItemTemplate>
<DataTemplate>
<Image Source="{Binding Path=ImageSource}" VerticalAlignment="Top" Margin="10,12,10,10" Width="640" Height="800">
</Image>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Run Code Online (Sandbox Code Playgroud)
我无法理解如何实施该解决方案.提前致谢.
我搜索了这么多,但找不到任何解决方案,所以我决定把我的问题放在这里......所以请原谅我,如果这是一个愚蠢的问题.
我从这里下载Silverlight工具包:http://silverlight.codeplex.com/releases/view/78435 [ Silverlight_5_Toolkit_December_2011.msi ].我安装后
我在windows7中发现了" Microsoft Silverlight 5 Toolkit December 2011 ",列出了" 所有程序 "列表.但当我点击" Toolkit Samples "时,它会显示" Missing Shortcut " 窗口.
当我解压缩" 示例源代码 "并打开解决方案" Silverlight.Controls.Samples.sln "时,它在我的" 解决方案资源管理器 "中加载了两个项目
(i)Controls.Samples和(ii)Controls.samples.Common
我发现当我点击" 参考 "节点时,很多参考文献都缺失了.例如:(i)System.Windows.Controls.Data.DataForm.Toolkit
(ii)System.Windows.Controls.DataVisualization.toolkit
等.....
我无法理解在哪里可以找到有助于摆脱缺失引用问题的DLL.
注意:我已检查" Sample source code.zip "中的两个名为" Binaries "的文件夹和所需DLL的" source code.zip "......但它对我没有帮助....
silverlight visual-studio-2010 silverlight-toolkit silverlight-5.0
silverlight ×6
c# ×2
charts ×2
wpf ×2
graph ×1
listpicker ×1
pie-chart ×1
windows ×1
wpftoolkit ×1