Click here to Skip to main content
       

Silverlight / WPF

 
GeneralRe: Is it safe to change datagridcolumn cell style at run time? PinmemberMycroft Holmes15-Feb-13 12:37 
GeneralRe: Is it safe to change datagridcolumn cell style at run time? PinmemberDr. Hurol Aslan15-Feb-13 14:43 
GeneralRe: Is it safe to change datagridcolumn cell style at run time? PinmemberMycroft Holmes15-Feb-13 14:53 
QuestionSend mail at a specific time Pinmemberslobo32014-Feb-13 2:27 
GeneralRe: Send mail at a specific time PinmemberPIEBALDconsult14-Feb-13 3:11 
AnswerRe: Send mail at a specific time PinmvpAbhinav S15-Feb-13 17:03 
QuestionEnterprise solution Pinmembervaishali thaker13-Feb-13 20:09 
AnswerRe: Enterprise solution PinmvpRichard MacCutchan13-Feb-13 22:32 
AnswerRe: Enterprise solution PinmemberSuper Lloyd14-Feb-13 18:04 
QuestionRe: Enterprise solution Pinmembervaishali thaker10-Apr-13 19:24 
QuestionChange 3 variables in another WPF window [modified] PinmemberGiuseppeKoll9-Feb-13 22:38 
AnswerRe: Change 3 variables in another WPF window PinmemberMycroft Holmes10-Feb-13 9:02 
GeneralRe: Change 3 variables in another WPF window PinmemberGiuseppeKoll10-Feb-13 9:40 
QuestionExpose Enum From Template PinmemberKevin Marois9-Feb-13 12:10 
I have this Image Button class:
 
public class ImageButton : Button
{
    public enum Direction
    { 
        Horizontal,
        Verticle
    }
 
    StackPanel panel = null;
    Image _Image = null;
    TextBlock _TextBlock = null;
 
    private Direction _Layout = Direction.Horizontal;
    public Direction Layout
    {
        get { return _Layout; }
        set
        {
            if (_Layout != value)
            {
                _Layout = value;
 
                panel.Orientation = _Layout == Direction.Horizontal ? System.Windows.Controls.Orientation.Horizontal : System.Windows.Controls.Orientation.Vertical;
            }
        }
    }
 
    public string Text
    {
        get
        {
            if (_TextBlock != null)
                return _TextBlock.Text;
            else
                return String.Empty;
        }
        set
        {
            if (_TextBlock != null)
                _TextBlock.Text = value;
        }
    }
 
    public ImageSource Image
    {
        get
        {
            if (_Image != null)
                return _Image.Source;
            else
                return null;
        }
        set
        {
            if (_Image != null)
                _Image.Source = value;
        }
    }
 
    public double ImageWidth
    {
        get
        {
            if (_Image != null)
                return _Image.Width;
            else
                return double.NaN;
        }
        set
        {
            if (_Image != null)
                _Image.Width = value;
        }
    }
 
    public double ImageHeight
    {
        get
        {
            if (_Image != null)
                return _Image.Height;
            else
                return double.NaN;
        }
        set
        {
            if (_Image != null)
                _Image.Height = value;
        }
    }
 
    public ImageButton()
    {
        _Image = new Image();
        _TextBlock = new TextBlock();
 
        panel = new StackPanel();
        panel.Orientation = System.Windows.Controls.Orientation.Horizontal;
        panel.Children.Add(_Image);
        panel.Children.Add(_TextBlock);
 
        this.Content = panel;
    }
 
}
 
 
This works great, except for one thing. When I set the Layout to Verticle...
<controls:ImageButton Grid.Row="1"
                        Grid.Column="0"
                        Image="Media/Images/customer_16.png"
                        ImageHeight="16"
                        ImageWidth="16"
                        Text="Test"
                        Layout="Verticle"
                        Height="55"
                        Width="100"
                        Command="{Binding OpenCustomerSelectionCommand}"/>
...the Layout property does not show the enum values. If I set it like I did above, it works, but I'd like the enaum values to appear.
 
Not sure how to do this. Can someone help me out here?
 
Thanks
If it's not broken, fix it until it is

AnswerRe: Expose Enum From Template PinmemberSledgeHammer019-Feb-13 13:43 
QuestionData Flow in a WPF App PinmemberAeroClassics9-Feb-13 11:19 
AnswerRe: Data Flow in a WPF App PinmemberSuper Lloyd14-Feb-13 18:08 
QuestionBinding DataGrid PinmemberSawyer19889-Feb-13 3:33 
AnswerRe: Binding DataGrid PinmemberAndy41128-Feb-13 2:25 
QuestionMain Widow Appears on top of the Navigated Window In WPF Navigation Service PinmemberVuyiswa Maseko6-Feb-13 0:43 
QuestionOpening new WPF form in seperate thread. PinmemberHema Bairavan2-Feb-13 8:31 
AnswerRe: Opening new WPF form in seperate thread. PinmemberSledgeHammer012-Feb-13 10:28 
GeneralRe: Opening new WPF form in seperate thread. PinmemberHema Bairavan3-Feb-13 2:57 
GeneralRe: Opening new WPF form in seperate thread. PinmemberSledgeHammer013-Feb-13 7:41 
GeneralRe: Opening new WPF form in seperate thread. PinmemberJason Gleim1-Mar-13 8:00 
QuestionHow to user control view open in center of main parent window ? Pinmemberrahul ameta2-Feb-13 1:56 
Questionarrange elements inside wpf PinmemberRemix Mixdox1-Feb-13 22:27 
AnswerRe: arrange elements inside wpf PinmvpAbhinav S3-Feb-13 7:02 
QuestionCustom Controls PinmemberSawyer19881-Feb-13 7:05 
QuestionApplication Launcher PinmemberMycroft Holmes31-Jan-13 13:49 
AnswerRe: Application Launcher PinmvpAbhinav S1-Feb-13 8:22 
QuestionWPF controls refresh Pinmembercaradri31-Jan-13 1:50 
AnswerRe: WPF controls refresh PinprotectorPete O'Hanlon31-Jan-13 2:44 
GeneralRe: WPF controls refresh Pinmembercaradri31-Jan-13 10:20 
GeneralRe: WPF controls refresh PinmemberRichard Deeming31-Jan-13 11:25 
GeneralRe: WPF controls refresh [modified] Pinmembercaradri2-Feb-13 17:59 
GeneralRe: WPF controls refresh Pinmembercaradri3-Feb-13 20:16 
QuestionRoutedEvent vs AttachedEvent Pinmemberdevvvy29-Jan-13 22:30 
AnswerRe: RoutedEvent vs AttachedEvent PinprotectorPete O'Hanlon29-Jan-13 22:51 
GeneralRe: RoutedEvent vs AttachedEvent [modified] Pinmemberdevvvy29-Jan-13 23:02 
GeneralRe: RoutedEvent vs AttachedEvent PinprotectorPete O'Hanlon30-Jan-13 0:45 
GeneralRe: RoutedEvent vs AttachedEvent Pinmemberdevvvy30-Jan-13 2:40 
GeneralRe: RoutedEvent vs AttachedEvent PinprotectorPete O'Hanlon30-Jan-13 2:44 
GeneralRe: RoutedEvent vs AttachedEvent Pinmemberdevvvy30-Jan-13 3:08 
QuestionWPF Tab Item Close Button [modified] PinmemberKevin Marois29-Jan-13 18:03 
AnswerRe: WPF Tab Item Close Button PinmemberSledgeHammer0129-Jan-13 19:02 
GeneralRe: WPF Tab Item Close Button PinmemberKevin Marois2-Feb-13 15:33 
GeneralRe: WPF Tab Item Close Button PinmemberSledgeHammer012-Feb-13 18:25 
QuestionCustom Control Template for beginners Pinmemberjeffdavis870329-Jan-13 9:12 
AnswerRe: Custom Control Template for beginners PinmemberSledgeHammer0129-Jan-13 11:32 

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

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


Advertise | Privacy | Mobile
Web02 | 2.8.140821.2 | Last Updated 21 Aug 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid