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

WPF

 
AnswerRe: Blurry Borderline In FlowDocument Pin
FocusedWolf7-Nov-12 16:00
FocusedWolf7-Nov-12 16:00 
Ok i figured out a way that works, although its a bit ugly:

XML
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <FlowDocumentScrollViewer>
        <FlowDocument>
        
            <Paragraph>
                <InlineUIContainer>
                    
                    <Border BorderBrush="Black" BorderThickness="1" Padding="10" SnapsToDevicePixels="True">
                        <Expander>
                            <Expander.Header>
                                <TextBlock Text="An expander" Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Expander}}, Path=ActualWidth}" />
                            </Expander.Header>
                                                
                            <Button>A button</Button>
                        </Expander>                    
                    </Border>
                    
                </InlineUIContainer>
            </Paragraph>
            
        </FlowDocument>
    </FlowDocumentScrollViewer>
</Window>


As for why, my code is based on this: http://stackoverflow.com/questions/3798262/how-to-collapse-a-paragraph although i've been improving it. The idea is add or remove a paragraph block below the expander block based on the state of the expander. That + code to handle the copy to clipboard to convert the uielements to text (in this case, getting the header string of the expander) and the result is an interactive flowdocument with collapsing regions and copy support.

modified 7-Nov-12 23:32pm.

QuestionBinding in a WPF TreeViewItem Pin
#realJSOP6-Nov-12 8:16
professional#realJSOP6-Nov-12 8:16 
AnswerRe: Binding in a WPF TreeViewItem Pin
Pete O'Hanlon6-Nov-12 8:29
mvePete O'Hanlon6-Nov-12 8:29 
GeneralRe: Binding in a WPF TreeViewItem Pin
#realJSOP6-Nov-12 8:54
professional#realJSOP6-Nov-12 8:54 
GeneralRe: Binding in a WPF TreeViewItem Pin
Pete O'Hanlon6-Nov-12 9:00
mvePete O'Hanlon6-Nov-12 9:00 
GeneralRe: Binding in a WPF TreeViewItem Pin
#realJSOP6-Nov-12 9:22
professional#realJSOP6-Nov-12 9:22 
GeneralRe: Binding in a WPF TreeViewItem Pin
Pete O'Hanlon6-Nov-12 9:29
mvePete O'Hanlon6-Nov-12 9:29 
GeneralRe: Binding in a WPF TreeViewItem Pin
#realJSOP6-Nov-12 9:37
professional#realJSOP6-Nov-12 9:37 
GeneralRe: Binding in a WPF TreeViewItem Pin
Pete O'Hanlon6-Nov-12 9:44
mvePete O'Hanlon6-Nov-12 9:44 
GeneralRe: Binding in a WPF TreeViewItem Pin
#realJSOP6-Nov-12 10:02
professional#realJSOP6-Nov-12 10:02 
GeneralRe: Binding in a WPF TreeViewItem Pin
#realJSOP6-Nov-12 10:13
professional#realJSOP6-Nov-12 10:13 
GeneralRe: Binding in a WPF TreeViewItem Pin
Pete O'Hanlon6-Nov-12 10:22
mvePete O'Hanlon6-Nov-12 10:22 
GeneralRe: Binding in a WPF TreeViewItem Pin
#realJSOP6-Nov-12 10:27
professional#realJSOP6-Nov-12 10:27 
GeneralRe: Binding in a WPF TreeViewItem Pin
Pete O'Hanlon6-Nov-12 10:28
mvePete O'Hanlon6-Nov-12 10:28 
GeneralRe: Binding in a WPF TreeViewItem Pin
#realJSOP7-Nov-12 3:53
professional#realJSOP7-Nov-12 3:53 
GeneralRe: Binding in a WPF TreeViewItem Pin
Pete O'Hanlon7-Nov-12 4:01
mvePete O'Hanlon7-Nov-12 4:01 
GeneralRe: Binding in a WPF TreeViewItem Pin
#realJSOP7-Nov-12 5:24
professional#realJSOP7-Nov-12 5:24 
GeneralRe: Binding in a WPF TreeViewItem Pin
#realJSOP8-Nov-12 4:30
professional#realJSOP8-Nov-12 4:30 
GeneralRe: Binding in a WPF TreeViewItem Pin
#realJSOP8-Nov-12 5:53
professional#realJSOP8-Nov-12 5:53 
GeneralRe: Binding in a WPF TreeViewItem Pin
#realJSOP8-Nov-12 10:13
professional#realJSOP8-Nov-12 10:13 
Questionslide menu Pin
HimmelDeveloper2-Nov-12 6:51
HimmelDeveloper2-Nov-12 6:51 
AnswerRe: slide menu Pin
Richard MacCutchan2-Nov-12 10:27
mveRichard MacCutchan2-Nov-12 10:27 
QuestionCustomized Scrollbar not working properly Pin
Anil_S.Kamble2-Nov-12 5:11
Anil_S.Kamble2-Nov-12 5:11 
QuestionCustom TreeViewItems Pin
#realJSOP2-Nov-12 4:06
professional#realJSOP2-Nov-12 4:06 
AnswerRe: Custom TreeViewItems Pin
SledgeHammer012-Nov-12 6:47
SledgeHammer012-Nov-12 6:47 

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.