在过去的几天里,我一直在玩Expressions Blend 4,我开始掌握它。我最近才开始玩数据绑定,发现它非常简单和强大。出于原型设计的目的,没有比这更好的应用了。
我目前正在制作一个具有潜在多级网格的Silverlight屏幕的原型。有什么方法可以用Blend做到这一点吗?我尝试创建一个多级数据示例(我向集合数据添加了一个集合数据),并将其拖到数据网格中。只有第一关出现了。
如有任何帮助,我们将不胜感激。
在过去的几天里,我一直在玩Expressions Blend 4,我开始掌握它。我最近才开始玩数据绑定,发现它非常简单和强大。出于原型设计的目的,没有比这更好的应用了。
我目前正在制作一个具有潜在多级网格的Silverlight屏幕的原型。有什么方法可以用Blend做到这一点吗?我尝试创建一个多级数据示例(我向集合数据添加了一个集合数据),并将其拖到数据网格中。只有第一关出现了。
如有任何帮助,我们将不胜感激。
可以使用网格作为面板的ItemsControl,然后在ItemTemplate中使用另一个ItemsControl,并使用另一网格将其绑定到第二级数据。使用ItemsControl,您可以对事物的显示方式进行大量控制,而不仅仅是使用网格。
If you need something that looks like this:
以下是实现这一目标的方法:
将多级示例数据源添加到Blend项目
将ItemsControl添加到布局根元素
将ItemsControl.ItemsSource属性绑定到父级
Create an empty item template using this option:
在项目模板中,创建希望第二级具有的结构。在我的示例中,结构如下所示:
将每个子元素绑定到父集合的项中的属性,如网格的标题。
将项内部的DataGrid绑定到子集合。
最终结果将是一个项目列表,每个项目将包含一个StackPanel、一个内部有TextBlock的Border和一个绑定到子数据的DataGrid。
此示例的XAML如下所示:
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:SampleData="clr-namespace:Expression.Blend.SampleData.SampleDataSource" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" mc:Ignorable="d"
x:Class="ASD_Answer005.MainPage" d:DesignWidth="703" d:DesignHeight="435">
<UserControl.Resources>
<SampleData:SampleDataSource x:Key="SampleDataSource" d:IsDataSource="True"/>
<DataTemplate x:Key="ChildDataTemplate">
<StackPanel Orientation="Vertical">
<Border BorderThickness="0,0,0,2" BorderBrush="Black" Padding="5">
<TextBlock TextWrapping="Wrap" Text="{Binding CategoryName}" FontSize="26.667" Height="39"/>
</Border>
<sdk:DataGrid ItemsSource="{Binding ChildCollection}" BorderThickness="0"/>
</StackPanel>
</DataTemplate>
</UserControl.Resources>
<d:DataContext>
<Binding Source="{StaticResource SampleDataSource}"/>
</d:DataContext>
<UserControl.DataContext>
<Binding Source="{StaticResource SampleDataSource}"/>
</UserControl.DataContext>
<Grid x:Name="LayoutRoot" Background="White">
<ScrollViewer HorizontalAlignment="Left" VerticalAlignment="Top" BorderThickness="0" Padding="0">
<StackPanel Orientation="Vertical" Width="703">
<ItemsControl ItemsSource="{Binding ParentCollection}" ItemTemplate="{StaticResource ChildDataTemplate}"/>
</StackPanel>
</ScrollViewer>
</Grid>
</UserControl>
我希望这能有所帮助。
any one can give me a hind how to split video (and can be played in separeat parts) ,by split here I mean to split it to 4 parts for example and each part can be running (paying)
I am trying to use Blend 3.0 to edit a project that contains some WPF controls. This project already compiles and runs fine from Visual Studio 2008. In Blend however, I m getting mysterious errors ...
When creating a control style & template in Blend for a WPF application, I want to take advantage of the Visual State Manager. How do I do this? Whenever I right-click over the button and select ...
I m working on a set of controls that has a number of DependencyProperties. The properties are themselves DependencyObjects and created during the get method of the properties. During the Get method, ...
I am doing some transition animation using WPF and Blend 3. I have two outer usercontrols which is what I want the transition effect to happen on. Using Blend I can make this effect. The problem is ...
Stupid question I know but how do i create one? All i need it to do is open up a dialog box and populate the text box next to it
Somehow, Expression Blend has entered full-screen mode (no window chrome), but I can still minimize/maximize/restore/move through the taskbar button. I don t see any menu options for full-screen mode,...
I have a network directory that has a dump of all employee pics here at our company. The images are named FirstnameLastinitial.jpg. I ultimately am trying to build a photo browser of these pics in ...