Click here to Skip to main content
15,914,014 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Snoop Pin
Paul Conrad7-Sep-08 5:24
professionalPaul Conrad7-Sep-08 5:24 
GeneralRe: Snoop Pin
Jammer7-Sep-08 23:30
Jammer7-Sep-08 23:30 
QuestionSmall question re: customized controls in WPF Pin
chaiguy13374-Sep-08 17:12
chaiguy13374-Sep-08 17:12 
AnswerRe: Small question re: customized controls in WPF Pin
Pete O'Hanlon4-Sep-08 22:46
mvePete O'Hanlon4-Sep-08 22:46 
GeneralRe: Small question re: customized controls in WPF Pin
chaiguy13375-Sep-08 5:10
chaiguy13375-Sep-08 5:10 
GeneralRe: Small question re: customized controls in WPF Pin
Pete O'Hanlon5-Sep-08 9:32
mvePete O'Hanlon5-Sep-08 9:32 
GeneralRe: Small question re: customized controls in WPF Pin
chaiguy13375-Sep-08 10:55
chaiguy13375-Sep-08 10:55 
AnswerRe: Small question re: customized controls in WPF Pin
Pete O'Hanlon5-Sep-08 10:07
mvePete O'Hanlon5-Sep-08 10:07 
Another really powerful feature of WPF is the ability to use converters. This could be done as:
<local:GreetingConverter x:Key="GreetingFormatter">
This is the actual text.
<StackPanel Orientation="Horizontal">
  <TextBlock Text="{Binding Mode=OneWay, Path=Name}"
    Converter={StaticResource GreetingFormatter} />
</StackPanel>
This would be the class that implements the converter:
using System;
using System.Windows.Data; 

namespace MySample.GreetingConverter
{
    [ValueConversion(typeof(object),typeof(string))]
    public class FormattingConverter: IValueConverter
    {
        public object Convert(object value, Type targetType, 
            object parameter, System.Globalization.CultureInfo culture)
        {
            return string.Format("Hello {0}, how are you?", value);
        } 

        public object ConvertBack(object value, Type targetType, 
            object parameter, System.Globalization.CultureInfo culture)
        {
            // we don't intend this to ever be called
            return null; 
        }
    }
} 


Deja View - the feeling that you've seen this post before.

My blog | My articles



GeneralRe: Small question re: customized controls in WPF Pin
chaiguy13375-Sep-08 10:11
chaiguy13375-Sep-08 10:11 
GeneralRe: Small question re: customized controls in WPF Pin
Insincere Dave5-Sep-08 12:49
Insincere Dave5-Sep-08 12:49 
GeneralRe: Small question re: customized controls in WPF Pin
chaiguy13375-Sep-08 20:06
chaiguy13375-Sep-08 20:06 
GeneralRe: Small question re: customized controls in WPF Pin
Pete O'Hanlon5-Sep-08 22:55
mvePete O'Hanlon5-Sep-08 22:55 
QuestionWPF - Creating Controls Dynamically on a Stack Panel Pin
Jonso4-Sep-08 15:15
Jonso4-Sep-08 15:15 
QuestionHow to enable Context menu for a listbox item. Pin
Aslesh4-Sep-08 6:22
Aslesh4-Sep-08 6:22 
AnswerRe: How to enable Context menu for a listbox item. Pin
Pete O'Hanlon4-Sep-08 8:42
mvePete O'Hanlon4-Sep-08 8:42 
Questionparsing HTML files Pin
swatikavdia3-Sep-08 23:33
swatikavdia3-Sep-08 23:33 
AnswerRe: parsing HTML files Pin
Michael Sync18-Oct-08 22:02
Michael Sync18-Oct-08 22:02 
QuestionAudio conferencing using WCF and WPF Pin
sumantamca3-Sep-08 21:55
sumantamca3-Sep-08 21:55 
QuestionParsing XML files [modified] Pin
skrajasthan3-Sep-08 21:52
skrajasthan3-Sep-08 21:52 
GeneralRe: Parsing XML files Pin
Pete O'Hanlon14-Sep-08 22:54
mvePete O'Hanlon14-Sep-08 22:54 
Questionreading XML files Pin
swatikavdia3-Sep-08 21:08
swatikavdia3-Sep-08 21:08 
AnswerRe: reading XML files Pin
Michael Sync18-Oct-08 22:08
Michael Sync18-Oct-08 22:08 
QuestionTextbox validation Pin
Aslesh3-Sep-08 4:52
Aslesh3-Sep-08 4:52 
AnswerRe: Textbox validation Pin
Pete O'Hanlon3-Sep-08 10:21
mvePete O'Hanlon3-Sep-08 10:21 
QuestionHow to animate Expander ? Pin
hdv2123-Sep-08 1:17
hdv2123-Sep-08 1:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.