Click here to Skip to main content
15,911,139 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: About Silver light Sql Data Connection Pin
Pete O'Hanlon15-Feb-13 5:46
mvePete O'Hanlon15-Feb-13 5:46 
AnswerRe: About Silver light Sql Data Connection Pin
Abhinav S15-Feb-13 17:01
Abhinav S15-Feb-13 17:01 
QuestionIs it safe to change datagridcolumn cell style at run time? Pin
Dr. Hurol Aslan14-Feb-13 17:03
Dr. Hurol Aslan14-Feb-13 17:03 
AnswerRe: Is it safe to change datagridcolumn cell style at run time? Pin
Marco Bertschi15-Feb-13 3:12
protectorMarco Bertschi15-Feb-13 3:12 
GeneralRe: Is it safe to change datagridcolumn cell style at run time? Pin
Dr. Hurol Aslan15-Feb-13 8:03
Dr. Hurol Aslan15-Feb-13 8:03 
GeneralRe: Is it safe to change datagridcolumn cell style at run time? Pin
Marco Bertschi15-Feb-13 8:04
protectorMarco Bertschi15-Feb-13 8:04 
GeneralRe: Is it safe to change datagridcolumn cell style at run time? Pin
Mycroft Holmes15-Feb-13 12:37
professionalMycroft Holmes15-Feb-13 12:37 
GeneralRe: Is it safe to change datagridcolumn cell style at run time? Pin
Dr. Hurol Aslan15-Feb-13 14:43
Dr. Hurol Aslan15-Feb-13 14:43 
GeneralRe: Is it safe to change datagridcolumn cell style at run time? Pin
Mycroft Holmes15-Feb-13 14:53
professionalMycroft Holmes15-Feb-13 14:53 
QuestionSend mail at a specific time Pin
LG014-Feb-13 2:27
LG014-Feb-13 2:27 
GeneralRe: Send mail at a specific time Pin
PIEBALDconsult14-Feb-13 3:11
mvePIEBALDconsult14-Feb-13 3:11 
AnswerRe: Send mail at a specific time Pin
Abhinav S15-Feb-13 17:03
Abhinav S15-Feb-13 17:03 
QuestionEnterprise solution Pin
vaishali thaker13-Feb-13 20:09
vaishali thaker13-Feb-13 20:09 
AnswerRe: Enterprise solution Pin
Richard MacCutchan13-Feb-13 22:32
mveRichard MacCutchan13-Feb-13 22:32 
AnswerRe: Enterprise solution Pin
Super Lloyd14-Feb-13 18:04
Super Lloyd14-Feb-13 18:04 
QuestionRe: Enterprise solution Pin
vaishali thaker10-Apr-13 19:24
vaishali thaker10-Apr-13 19:24 
QuestionChange 3 variables in another WPF window Pin
GiuseppeKoll9-Feb-13 22:38
GiuseppeKoll9-Feb-13 22:38 
AnswerRe: Change 3 variables in another WPF window Pin
Mycroft Holmes10-Feb-13 9:02
professionalMycroft Holmes10-Feb-13 9:02 
GeneralRe: Change 3 variables in another WPF window Pin
GiuseppeKoll10-Feb-13 9:40
GiuseppeKoll10-Feb-13 9:40 
QuestionExpose Enum From Template Pin
Kevin Marois9-Feb-13 12:10
professionalKevin 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 Pin
SledgeHammer019-Feb-13 13:43
SledgeHammer019-Feb-13 13:43 
QuestionData Flow in a WPF App Pin
AeroClassics9-Feb-13 11:19
professionalAeroClassics9-Feb-13 11:19 
AnswerRe: Data Flow in a WPF App Pin
Super Lloyd14-Feb-13 18:08
Super Lloyd14-Feb-13 18:08 
QuestionBinding DataGrid Pin
Sawyer19889-Feb-13 3:33
Sawyer19889-Feb-13 3:33 
AnswerRe: Binding DataGrid Pin
Andy41128-Feb-13 2:25
Andy41128-Feb-13 2:25 

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.