霸王硬上弓:不熟Silverlight,确要做LightSwitch扩展,问关于TreeView的一个问题

wumylove1234 2012-11-03 07:44:01

<UserControl x:Class="ProjectExtension.Presentation.Controls.TreeControl"
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:local="clr-namespace:ProjectExtension"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">

<UserControl.Resources>
<local:EntityCollectionValueConverter x:Key="EntityCollectionValueConverter" />
<sdk:HierarchicalDataTemplate x:Key="HTemplate"
ItemsSource="{Binding Converter={StaticResource EntityCollectionValueConverter}, ConverterParameter=Categories}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=CategoryName, Mode=TwoWay}"
Margin="5,0" Width="74" />
</StackPanel>
</sdk:HierarchicalDataTemplate>
</UserControl.Resources>

<Grid DataContext="{Binding Value}" x:Name="LayoutRoot" Background="White">
<StackPanel Orientation="Horizontal">

<sdk:TreeView Name="treeViewControl" ItemsSource="{Binding}" SelectedItemChanged="treeViewControl_SelectedItemChanged" ItemTemplate="{StaticResource HTemplate}">

</sdk:TreeView>

</StackPanel>
</Grid></UserControl>


我需要在后台代码中动态控制两个地方:
1、<sdk:HierarchicalDataTemplate x:Key="HTemplate"
ItemsSource="{Binding Converter={StaticResource EntityCollectionValueConverter}, ConverterParameter=Categories}">
其中的Categories我需要动态赋值

2<TextBlock Text="{Binding Path=CategoryName, Mode=TwoWay}"
Margin="5,0" Width="74" />

其中的Path属性我需要在后台代码中进行赋值。

完全不懂Silverlight,在后台代码中根本找不到这两个东西的引用,如何来搞呀?急呀~~
...全文
942 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
wumylove1234 2012-11-03
  • 打赏
  • 举报
回复
就是<sdk:HierarchicalDataTemplate x:Key="HTemplate" ItemsSource="{Binding Converter={StaticResource EntityCollectionValueConverter}, ConverterParameter=}"> 其中的Categories我需要动态赋值 2<TextBlock Text="{Binding Path=, Mode=TwoWay}" Margin="5,0" Width="74" /> 就是这两个?号的地方,需要在后台代码里动态指定,有没有办法呀?
In this fully updated second edition, award-winning author Tim Leung explains how to build data-centric business applications for the desktop, cloud, web, and mobile devices in just a few clicks―with no code required―using Visual Studio Lightswitch 2015. This book explains the basics of Visual Studio Lightswitch 2015 plus new features and key advanced topics that every Microsoft developer needs to know to create modern data services and build clients that can run on multiple devices. Visual Studio LightSwitch 2015 is a rapid application deployment tool that simplifies and shortens the time needed to develop business applications. The basics are very easily understood but more advanced users will hunger for more. How do you design complex layouts? How do you query data using LINQ and other syntax structures? How do you secure your application against malicious use? Visual Studio LightSwitch 2015 answers these questions and more as author Tim Leung―winner of a Microsoft 2011 Community Contributor Award for his LightSwitch expertise―covers this breakthrough product in detail. For serious developers building, enhancing, and deploying advanced business applications using LightSwitch makes sense because they can benefit from the elegance, convenience, and cost savings afforded by rapid application development before going beyond the "click-and-you're-done" interface to include the extra value and depth of coding expertise that their clients value. What You Will Learn: Build Desktop and HTML5 business applications for PC or mobile devices Create compelling user interfaces that can support multiple languages Fine tune your application with C#, VB.NET, JQuery, JavaScript, and CSS code Integrate with mapping, GPS, and location services Provide email notification, and Microsoft Office compatible data exports Enable users to carry out advanced searches on data Build screen controls that you can share with other developers Table of Contents Part I: Introducing LightSwitch Chapter 1: Introducing LightSwitch Chapter 2: Setting Up Your Data Chapter 3: Building HTML Applications Chapter 4: Creating Desktop Applications Part II: Working with Data Chapter 5: Quer ying Your Data Chapter 6: Writing Data-Access Code Chapter 7: Validating Data Part III: Writing ScreenCode Chapter 8: Refinining HTML Clients Screens with JavaScript/CSS Chapter 9: Enhancing Desktop Screens with .NET Code Part IV: Refining Your Application Chapter 10: Searching Data Chapter 11: Building Practical Application Features Chapter 12: Supporting Multiple Languages Chapter 13: Creating and Using Custom Controls Part V: Extending the Reach of Your Data Chapter 14: Optimizing Data Connectivity with RIA Services Chapter 15: Sharing Data with OData Part VI: Getting Data Out Chapter 16: Creating Reports Chapter 17: Generating Office Documents Chapter 18: Sending Email Part VII: Extending LightSwitch Chapter 19: Creating Control Extensions Chapter 20: Creating Data and Presentation Extensions Part VIII: Securing Your Application Chapter 21: Authenticating Your Users Chapter 22: Authorizing Your Users Part IX: Going Live with Your Application Chapter 23: Deploying Applications Appendix A: Culture Names Appendix B: Data Type Identifiers Appendix C: Using Properties in Custom Controls Appendix D: Custom Screen Template View IDs Appendix E: Data Schemas

8,735

社区成员

发帖
与我相关
我的任务
社区描述
WPF/Silverlight相关讨论
社区管理员
  • WPF/Silverlight社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧