Click here to Skip to main content
15,895,827 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Silverlight on Linux(Ubuntu) Pin
Mycroft Holmes19-Oct-12 13:31
professionalMycroft Holmes19-Oct-12 13:31 
AnswerRe: Silverlight on Linux(Ubuntu) Pin
ThatsAlok21-Oct-12 1:52
ThatsAlok21-Oct-12 1:52 
GeneralRe: Silverlight on Linux(Ubuntu) Pin
trønderen12-Dec-12 11:50
trønderen12-Dec-12 11:50 
GeneralRe: Silverlight on Linux(Ubuntu) Pin
Mycroft Holmes12-Dec-12 13:19
professionalMycroft Holmes12-Dec-12 13:19 
QuestionForm_Load equivalent from C#.Silverlight Pin
wizshrutz15-Oct-12 17:54
wizshrutz15-Oct-12 17:54 
AnswerRe: Form_Load equivalent from C#.Silverlight Pin
Abhinav S15-Oct-12 18:09
Abhinav S15-Oct-12 18:09 
AnswerRe: Form_Load equivalent from C#.Silverlight Pin
dbaseman23-Oct-12 17:01
dbaseman23-Oct-12 17:01 
QuestionWPF PropertyGrid with Custom Editor Pin
#realJSOP15-Oct-12 10:17
mve#realJSOP15-Oct-12 10:17 
I'm using the WPF Extended Toolkit PropertyGrid (v1.7), and I'm trying to setup a custom editor to display a dialog box when the user clicks a button. My problem is that I can't get the property grid to display the editor panel at all.

I tried doing it this way, but it wouldn't display, and after some investigation in the debugger, I noticed that the template's VisualTree was null:

C#
public class CDSceneSelectorEditor : DialogPropertyValueEditor
{
    public CDSceneSelectorEditor()
    {

        string template = 
            @"<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
                            xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
//                          xmlns:pe='clr-namespace:System.Activities.Presentation.PropertyEditing;assembly=System.Activities.Presentation'>
                <DockPanel LastChildFill='True'>
                <pe:EditModeSwitchButton TargetEditMode='Dialog' Name='EditButton' 
                                         DockPanel.Dock='Right' Content='...' />
                <TextBlock Text='Picture' Margin='2,0,0,0' 
                           VerticalAlignment='Center'/>
            </DockPanel>
        </DataTemplate>";

        try
        {
            using (var sr = new MemoryStream(Encoding.UTF8.GetBytes(template)))
            {
                this.InlineEditorTemplate = (DataTemplate)(XamlReader.Load(sr));
            }
        }
        catch (Exception ex)
        {
            if (ex != null) {}
        }
    }
}


So, I figured that the visual tree must be the issue, so I tried it this way, which gave me a VistalTree, but didn't change the outcome:

C#
public class CDSceneSelectorEditor : DialogPropertyValueEditor
{
    public CDSceneSelectorEditor()
    {
        var button = new FrameworkElementFactory(typeof(EditModeSwitchButton))
                         { Name = "EditButton"     };
        button.SetValue(DockPanel.DockProperty, Dock.Right);
        button.SetValue(EditModeSwitchButton.TargetEditModeProperty, 
                        PropertyContainerEditMode.Dialog);
        button.SetValue(EditModeSwitchButton.ContentProperty, " ... ");
        button.SetValue(TextBlock.MarginProperty, new Thickness(0,0,3,0));

        var image  = new FrameworkElementFactory(typeof(Image))
                         { Name = "ThumbnailImage" };
        image.SetValue(Image.StretchProperty, 
                       System.Windows.Media.Stretch.Uniform);

        var panel  = new FrameworkElementFactory(typeof(DockPanel));
        panel.AppendChild(button);
        panel.AppendChild(image);

        DataTemplate template = new DataTemplate();
        template.VisualTree = panel;
        this.InlineEditorTemplate = template;
    }
}


I am out of ideas, and google has been no help at all.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997


QuestionHow to draw a vertical line chart? Pin
haody007014-Oct-12 21:38
haody007014-Oct-12 21:38 
NewsWPF TreeView Problem Pin
Kevin Marois12-Oct-12 17:19
professionalKevin Marois12-Oct-12 17:19 
GeneralRe: WPF TreeView Problem Pin
Mycroft Holmes14-Oct-12 15:31
professionalMycroft Holmes14-Oct-12 15:31 
GeneralRe: WPF TreeView Problem Pin
#realJSOP15-Oct-12 11:18
mve#realJSOP15-Oct-12 11:18 
GeneralRe: WPF TreeView Problem Pin
Kevin Marois16-Oct-12 6:07
professionalKevin Marois16-Oct-12 6:07 
GeneralRe: WPF TreeView Problem Pin
#realJSOP16-Oct-12 8:42
mve#realJSOP16-Oct-12 8:42 
GeneralRe: WPF TreeView Problem Pin
Kevin Marois16-Oct-12 8:43
professionalKevin Marois16-Oct-12 8:43 
GeneralRe: WPF TreeView Problem Pin
#realJSOP17-Oct-12 4:39
mve#realJSOP17-Oct-12 4:39 
GeneralRe: WPF TreeView Problem Pin
Kevin Marois17-Oct-12 5:10
professionalKevin Marois17-Oct-12 5:10 
QuestionWPF Datagrid grouping with dynamic columns Pin
Member 93422189-Oct-12 20:45
Member 93422189-Oct-12 20:45 
AnswerRe: WPF Datagrid grouping with dynamic columns Pin
Mycroft Holmes14-Oct-12 15:35
professionalMycroft Holmes14-Oct-12 15:35 
QuestionUsing the ComponentResourceKey Pin
ElPicoso9-Oct-12 8:21
ElPicoso9-Oct-12 8:21 
QuestionSilvelight : Canvas with checkbox create in dynamically like theater sit booking Pin
Shaikh Daniyal9-Oct-12 3:06
professionalShaikh Daniyal9-Oct-12 3:06 
AnswerRe: Silvelight : Canvas with checkbox create in dynamically like theater sit booking Pin
Pete O'Hanlon9-Oct-12 3:11
mvePete O'Hanlon9-Oct-12 3:11 
QuestionByte[] of PDF into image Pin
GomathiR9-Oct-12 2:43
GomathiR9-Oct-12 2:43 
AnswerRe: Byte[] of PDF into image Pin
Pete O'Hanlon9-Oct-12 2:57
mvePete O'Hanlon9-Oct-12 2:57 
GeneralRe: Byte[] of PDF into image Pin
GomathiR9-Oct-12 21:23
GomathiR9-Oct-12 21:23 

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.