| Blog Name: |
Between API |
| Url: |
http://betweenapis.blogspot.com |
| Language: |
English |
| Topics: |
programming, API, tips |
| Description: |
Blog about the day to day life of a programmer traveling around languages, APIs, forums and new technologies. |
| Popularity: |
1 Followers |
WPF #6 - Creating a RoutedEvent
Just to keep my posting average posting new tips, this is an easy one with an example on how to make a Routed event.A routed event is just like a regular event, but it has one other great functionality, it can invoke handlers on multiple listeners in an element tree, rather than just on the object that raised the event (via MSDN).public class MyButtonSimple: Button{ // Create a custom routed event by first registering a RoutedEventID // This event uses the bubbling routing strategy public static readonly RoutedEvent TapEvent = Eve
WPF #5 - Styling using MultiTrigger (MultiCondition setter)
Hi again, I noticed that I'm not explaining my tips that much, I wonder if this is happening due to the fact that I've only posted quick tips or if it is an actual issue. Well, I'm more an example guy than a theory guy, for me is always easy to understand using examples than any other way. So if anyone read one of the tips and didn't understand it, please leave a comment so I can try to explain it better.Now, this post tip, how to use MultiTrigger (or MultiConditions setters) in WPF, the following example pretty much explains itself:<Style targettype="{x:Type Button}"> ... <Style.Triggers> <MultiTrigger> <
DOT.NET - Make invalid UTF8 charatcters available in XML
To change my posts a little lets talk about .NET, not WPF, a .NET little trick I discovered when creating UTF8 enabled XML files.If you want to enable UTF8 files through an editor you would have to do the following:<?xml version="1.0" encoding="ISO-8859-1"?>And to do the same when you use a XmlWriter (that's the trick), you first have to set the Encoding of the XmlWriter and then you just have to force it to write the start document element.XmlTextWriter objWriter = new XmlTextWriter(sPath, Encoding.UTF8);objWriter.WriteStartDocument();Hope it helps!
WPF #4 - Scroll to a ListViewItem programatically
Hi guys, now you have to be tired of WPF tips. Aren't you?Well, after playing around a little bit with ListView I've bumped into a problem, how to select an item programatically?Couldn't be easier:this.listView.ScrollIntoView(this.listView.Items[index]);Pretty neat right?See ya next time!
WPF #3 - Get ListViewItem from its data bound
Another WPF tip, aren't you guys tired of them yet?Well, this is another quick one, how to get an ListBoxItem or ListViewItem when you have the item that was bound to it.ListViewItem objItem = myListView.ItemContainerGenerator.ContainerFromItem(objMyData); Pretty easy right? Or as we brazilians say: fácil!
Not enough data.
Calculated for blogs with 20+ followers.
- Byroniac (Wordpress)
Computers, Programming, Database
- TameBay
ebay, ecommerce, tips
- ChrisEnnis.com
technology, web development, API
- Christina's Blog
web, programming, technology
- GeeksWithBlogs - Wes Weeks
Application Development, Microsoft CRM, Programming
Questions? contact: networkedblogs@ninua.com
Copyright (C) 2008, Ninua, Inc.