Click here to Skip to main content
15,898,588 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Shapes drawn on multiscale image prevent image mouse events. How to fix it? Pin
SledgeHammer0127-Jun-12 11:23
SledgeHammer0127-Jun-12 11:23 
QuestionConvert PDF Pages to Image - Silverlight Pin
NeCroFire26-Jun-12 22:33
NeCroFire26-Jun-12 22:33 
QuestionWPF Set FontWeight From Trigger Pin
Kevin Marois26-Jun-12 6:11
professionalKevin Marois26-Jun-12 6:11 
AnswerRe: WPF Set FontWeight From Trigger Pin
Pete O'Hanlon26-Jun-12 6:24
mvePete O'Hanlon26-Jun-12 6:24 
GeneralRe: WPF Set FontWeight From Trigger Pin
Kevin Marois26-Jun-12 6:35
professionalKevin Marois26-Jun-12 6:35 
GeneralRe: WPF Set FontWeight From Trigger Pin
Ian Shlasko26-Jun-12 7:07
Ian Shlasko26-Jun-12 7:07 
GeneralRe: WPF Set FontWeight From Trigger Pin
Pete O'Hanlon26-Jun-12 9:29
mvePete O'Hanlon26-Jun-12 9:29 
GeneralRe: WPF Set FontWeight From Trigger Pin
Kevin Marois27-Jun-12 6:20
professionalKevin Marois27-Jun-12 6:20 
Ok, I'v been working with this, but I can't get it quite right.

I have a disabled list which acts as a table of contens for a series of 'pages'. When a page becomes active, the TOC item for it needs to be bold.

So here's my list:

<ListBox Grid.Row="1"
            Grid.Column="0"
            Width="225"
            ItemsSource="{Binding TOC}"
            BorderBrush="SlateBlue"
            BorderThickness=".5"
            Padding="10"
            IsEnabled="False">
            
    <ListBox.Resources>
        <DataTemplate DataType="{x:Type models:TOCModel}">
            <StackPanel Orientation="Horizontal"
                        Margin="2">
                <TextBlock Text="{Binding Caption}">
                </TextBlock>
            </StackPanel>
        </DataTemplate>
    </ListBox.Resources>
            
</ListBox>


and here's my style:

<Style TargetType="{x:Type ListBox}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type ListBox}">
                <Grid Width="Auto" 
                        Height="Auto">
                    <Border x:Name="Border"
                            BorderBrush="SlateBlue"
                            BorderThickness=".5"/>
                    <ScrollViewer Focusable="false" 
                                    IsTabStop="False" 
                                    Margin="8"
                                    HorizontalScrollBarVisibility="Disabled">
                        <StackPanel IsItemsHost="true"/>
                    </ScrollViewer>
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Background" Value="White"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
    <Setter Property="Background" Value="White"/>
</Style>            


The list is bound to a collection of TOCModels:

public class TOCModel
{
    public string Caption { get; set; }
    public bool IsCurrentItem { get; set; }
}


I think I need a DataTemplate for the TOC Items to set the FontWeight to bold when IsCurrentItem = true, but I don't know where to add it.

Could use some help.

Thanks
If it's not broken, fix it until it is

GeneralRe: WPF Set FontWeight From Trigger Pin
Pete O'Hanlon27-Jun-12 7:00
mvePete O'Hanlon27-Jun-12 7:00 
Questionhow to create graph in wpf Pin
santy143all24-Jun-12 22:26
santy143all24-Jun-12 22:26 
AnswerRe: how to create graph in wpf Pin
Richard MacCutchan24-Jun-12 22:54
mveRichard MacCutchan24-Jun-12 22:54 
AnswerRe: how to create graph in wpf Pin
Abhinav S25-Jun-12 0:52
Abhinav S25-Jun-12 0:52 
AnswerRe: how to create graph in wpf Pin
Unnikrishnan_S_N3-Jul-12 2:21
Unnikrishnan_S_N3-Jul-12 2:21 
QuestionWhat I should do to not Validate form First time? Pin
wasimsharp24-Jun-12 18:42
wasimsharp24-Jun-12 18:42 
AnswerRe: What I should do to not Validate form First time? Pin
Abhinav S24-Jun-12 20:02
Abhinav S24-Jun-12 20:02 
QuestionRender WPF Control to Image in Console App Pin
#realJSOP24-Jun-12 12:18
professional#realJSOP24-Jun-12 12:18 
AnswerRe: Render WPF Control to Image in Console App Pin
Abhinav S24-Jun-12 20:09
Abhinav S24-Jun-12 20:09 
GeneralRe: Render WPF Control to Image in Console App Pin
#realJSOP25-Jun-12 0:30
professional#realJSOP25-Jun-12 0:30 
GeneralRe: Render WPF Control to Image in Console App Pin
#realJSOP25-Jun-12 3:13
professional#realJSOP25-Jun-12 3:13 
GeneralRe: Render WPF Control to Image in Console App Pin
Abhinav S25-Jun-12 3:22
Abhinav S25-Jun-12 3:22 
GeneralRe: Render WPF Control to Image in Console App Pin
#realJSOP25-Jun-12 6:23
professional#realJSOP25-Jun-12 6:23 
GeneralRe: Render WPF Control to Image in Console App Pin
Pete O'Hanlon25-Jun-12 3:28
mvePete O'Hanlon25-Jun-12 3:28 
GeneralRe: Render WPF Control to Image in Console App Pin
#realJSOP25-Jun-12 6:23
professional#realJSOP25-Jun-12 6:23 
GeneralRe: Render WPF Control to Image in Console App Pin
#realJSOP25-Jun-12 3:49
professional#realJSOP25-Jun-12 3:49 
AnswerRe: Render WPF Control to Image in Console App Pin
JOAT-MON25-Jun-12 9:17
JOAT-MON25-Jun-12 9:17 

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.