C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




how to convert this xaml to c sharp


Posted Date: 02 Jul 2008      Total Responses: 3

Posted By: Smith       Member Level: Bronze     Points: 1



<ControlTemplate TargetType=“TreeViewItem”> <StackPanel Margin=“10,2,0,0?> <WrapPanel Name=“item”> <ToggleButton Name=“expander” IsChecked=“{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsExpanded}" Content=“+”/> <ContentPresenter x:Name=“PART_Header” ContentSource=“Header” /> </WrapPanel> <Border> <ItemsPresenter Name=“children” Visibility=“Collapsed” /> </Border> </StackPanel> <ControlTemplate.Triggers> <Trigger Property=“IsSelected” Value=“True”> <Setter TargetName=“item” Property=“Background” Value=“LightBlue”/> </Trigger> <Trigger Property=“IsExpanded” Value=“True”> <Setter TargetName=“children” Property=“Visibility” Value=“Visible”/> </Trigger> <Trigger Property=“HasItems” Value=“False”> <Setter TargetName=“expander” Property=“Visibility” Value=“Collapsed”/> </Trigger> <Trigger Property=“local:MyTreeView.IsRootNode” Value=“True”> <Setter TargetName=“item” Property=“Background” Value=“Silver”/> <Setter TargetName=“item” Property=“Height” Value=“50?/> </Trigger> </ControlTemplate.Triggers></ControlTemplate>




Responses

Author: Parashu(Swathimutyam)    03 Jul 2008Member Level: GoldRating:     Points: 2

you can read this XML file using serialization and one more method is you can read the xml file



regards,
Parashu



Author: Muthaiah Thiagrajan    23 Jul 2008Member Level: BronzeRating:     Points: 6

Hi,

I saw the previous person's reply for smith's post.
the answer is not relavent to what Smith has asked! It's not XML,both the methods mentioned above are not relevant to this context.
This is XAML control template for TreeViewItem. This is about skinning the control!

My answer :

Hi Smith,
As per my knowledge, you cannot convert the above XAML into C#. You can probably use createFromXaml for creating the control and it's look and feel in backend .cs page.

There is a simple example given by Jesse Liberty in the below link, gothrough that , it may give you an idea about runtime XAML creation.

The link:
http://silverlight.net/blogs/jesseliberty/archive/2008/02/04/did-you-know-code-behind-in-1-0-is-straight-javascript-where-to-learn-more.aspx




Author: kannan    25 Sep 2008Member Level: BronzeRating:     Points: 0




70-316.pdf
Post Reply
You must Sign In to post a response.
Next : WPF+Textures Mapping
Previous : drag and drop a wpf tree view
Return to Discussion Forum
Post New Message
Category: WPF

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use