Click here to Skip to main content
15,896,727 members
Home / Discussions / WPF
   

WPF

 
QuestionHow can I set my dynamic images in random position? Pin
Kunal Chowdhury «IN»3-Aug-09 21:13
professionalKunal Chowdhury «IN»3-Aug-09 21:13 
AnswerRe: How can I set my dynamic images in random position? Pin
Christian Graus3-Aug-09 22:47
protectorChristian Graus3-Aug-09 22:47 
QuestionHow i can add new buttons to my epander control Pin
wasimsharp3-Aug-09 20:40
wasimsharp3-Aug-09 20:40 
AnswerRe: How i can add new buttons to my epander control Pin
Super Lloyd4-Aug-09 0:47
Super Lloyd4-Aug-09 0:47 
GeneralRe: How i can add new buttons to my epander control Pin
wasimsharp4-Aug-09 1:27
wasimsharp4-Aug-09 1:27 
GeneralRe: How i can add new buttons to my epander control Pin
Super Lloyd4-Aug-09 1:40
Super Lloyd4-Aug-09 1:40 
AnswerRe: How i can add new buttons to my epander control Pin
wasimsharp4-Aug-09 1:56
wasimsharp4-Aug-09 1:56 
QuestionCustom classes in XAML - Assign properties after parents set Pin
Ian Shlasko3-Aug-09 4:15
Ian Shlasko3-Aug-09 4:15 
Ok, quick background (actual question in bold below):

I built my own set of classes to define in XAML, sort of like a template to be used in multiple formats. In this case, representing a spreadsheet either on the screen or as an export to Excel. Looks like this:

<vm:SpreadsheetView>  <-- GUI component inheriting from WPF Grid panel

    <vm:SpreadsheetView.Model>   <--- Property
        <Spreadsheet>      <-- Non-GUI objects, that get translated
            <Spreadsheet.Styles>
                <NamedStyle Key="x">FS=B</NamedStyle>
            </Spreadsheet.Styles>

            <RegionElement>
                <Cell>Testing</Cell>
                <Cell ColSpan="2">Next Cell</Cell>
                <Cell Row="1" Col="2" Style="@x">Over Here</Cell>
                <Cell Row="2" Col="1">Down here too</Cell>
            </RegionElement>
        </Spreadsheet>
    </vm:SpreadsheetView.Model>
</vm:SpreadsheetView>


Basically, the SpreadsheetView reads in a tree of my homemade classes, sets up column definitions, and builds a spreadsheet-like view for it. It just walks down through the child tree whenever the Model property is set. Simple enough.

Now, all of my model classes use a simple parent/child setup, where everything has a parent object except the top-level one. RegionElements have a "Children" property, which is an inherited ObservableCollection that sets the parent of a child element when it's added (Overrides the Set/Insert/Remove/Clear). This works just fine.

The trick is the order in which things happen... What I need is for the properties (Specifically the Style property) to not be assigned until AFTER the element is added to the parent, since the styles walk up the tree to find values.

I've tried the DependsOn attribute: [System.Windows.Markup.DependsOn("Parent")]
But that doesn't work, since the Parent property is set through code. Is there any way I can tell the XAML parser to not set that property until afterward?

Proud to have finally moved to the A-Ark. Which one are you in?
Developer, Author (Guardians of Xen)

AnswerRe: Custom classes in XAML - Assign properties after parents set Pin
Super Lloyd4-Aug-09 3:14
Super Lloyd4-Aug-09 3:14 
GeneralRe: Custom classes in XAML - Assign properties after parents set Pin
Ian Shlasko4-Aug-09 12:14
Ian Shlasko4-Aug-09 12:14 
GeneralRe: Custom classes in XAML - Assign properties after parents set Pin
Super Lloyd4-Aug-09 13:06
Super Lloyd4-Aug-09 13:06 
GeneralRe: Custom classes in XAML - Assign properties after parents set Pin
Ian Shlasko4-Aug-09 15:57
Ian Shlasko4-Aug-09 15:57 
QuestionHow can I cache data in WPF application? Pin
Kunal Chowdhury «IN»3-Aug-09 1:06
professionalKunal Chowdhury «IN»3-Aug-09 1:06 
AnswerRe: How can I cache data in WPF application? Pin
Pete O'Hanlon3-Aug-09 1:32
mvePete O'Hanlon3-Aug-09 1:32 
AnswerRe: How can I cache data in WPF application? Pin
Kunal Chowdhury «IN»3-Aug-09 2:43
professionalKunal Chowdhury «IN»3-Aug-09 2:43 
QuestionHow to Give Header in multicolunm TreeView and also implement sorting algo? Pin
sachinjadhavcm2-Aug-09 23:54
sachinjadhavcm2-Aug-09 23:54 
QuestionAdjusting Panels in WPF programatically ? Pin
Krishna Aditya2-Aug-09 20:31
Krishna Aditya2-Aug-09 20:31 
AnswerRe: Adjusting Panels in WPF programatically ? Pin
Christian Graus2-Aug-09 22:02
protectorChristian Graus2-Aug-09 22:02 
QuestionGlobal Styles - Update Pin
#realJSOP2-Aug-09 1:02
professional#realJSOP2-Aug-09 1:02 
QuestionHow to display a document in silverlight? Pin
CBenac31-Jul-09 14:27
CBenac31-Jul-09 14:27 
AnswerRe: How to display a document in silverlight? Pin
Michael Sync31-Jul-09 18:21
Michael Sync31-Jul-09 18:21 
QuestionUse Themes? Pin
#realJSOP31-Jul-09 1:09
professional#realJSOP31-Jul-09 1:09 
AnswerRe: Use Themes? Pin
Super Lloyd31-Jul-09 1:52
Super Lloyd31-Jul-09 1:52 
AnswerRe: Use Themes? Pin
Pete O'Hanlon31-Jul-09 1:53
mvePete O'Hanlon31-Jul-09 1:53 
QuestionHow to add silverlight. Pin
Blikkies30-Jul-09 21:20
professionalBlikkies30-Jul-09 21:20 

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.