WPF: How hard could it be to get a SelectedItemTemplate?

Posted by: Rick Strahls WebLog, on 24 May 2007 | View original | NEW Bookmarked: 0 time(s)

Here's a fun one to do in WPF. Say you have a ListBox or ListView that is databound and you want to get at the content of the data template used for binding of the items in the list. In my case I want to trigger an animation when the item is selected to indicate the change. It's quite easy to get a selected item from a list box:  // *** Bound item - ie. an XmlNode/XmlElement XmlElement item = this.lstPhotos.SelectedItem as XmlElement; if (item == null)     return; This assumes...

Advertisement
Category: WPF | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 1147 | Hits: 181

Similar Posts

  • Building a Better Windows Mobile Development Experience more
  • Using T4 Templates for Simple DTOs more
  • ASP.NET disk-based caching more
  • Writing meaningful, self-documenting, behavior-oriented tests more
  • The Downside of Transparency more
  • Have I Missed The Bus? more
  • Silverlight 3 Multi-touch: The Basics more
  • PM Tip #10: Interview Tips for Landing a Great Program Management Job more
  • Silverlight 3 Multi-touch: The Basics more
  • Silverlight 3 Multi-touch: The Basics more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD