Click here to Skip to main content
15,900,108 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Use TTF Font From Resources Pin
Richard Deeming29-Apr-16 2:18
mveRichard Deeming29-Apr-16 2:18 
GeneralRe: Use TTF Font From Resources Pin
Kevin Marois29-Apr-16 5:21
professionalKevin Marois29-Apr-16 5:21 
GeneralRe: Use TTF Font From Resources Pin
Kevin Marois29-Apr-16 5:26
professionalKevin Marois29-Apr-16 5:26 
GeneralRe: Use TTF Font From Resources Pin
Kevin Marois29-Apr-16 5:43
professionalKevin Marois29-Apr-16 5:43 
QuestionSave And Restore Attached Property Values Pin
Kevin Marois27-Apr-16 11:53
professionalKevin Marois27-Apr-16 11:53 
AnswerRe: Save And Restore Attached Property Values Pin
Mycroft Holmes27-Apr-16 14:34
professionalMycroft Holmes27-Apr-16 14:34 
GeneralRe: Save And Restore Attached Property Values Pin
Kevin Marois28-Apr-16 6:47
professionalKevin Marois28-Apr-16 6:47 
AnswerRe: Save And Restore Attached Property Values Pin
Richard Deeming28-Apr-16 8:30
mveRichard Deeming28-Apr-16 8:30 
How about adding an inherited DP to the root, and using a trigger against the elements you want to hide? That way, WPF will take care of setting and resetting the visibility property on the child elements for you.
C#
public static readonly DependencyProperty IsReportModeProperty = DependencyProperty.RegisterAttached(
    "IsReportMode", typeof(Boolean), typeof(PrintLib),
    new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Inherits));

public static bool GetIsReportMode(UIElement target)
{
    return (bool)target.GetValue(IsReportModeProperty);
}

public static bool SetIsReportMode(UIElement target, bool value)
{
    target.SetValue(IsReportModeProperty, value);
}

XML
<Style TargetType="{x:Type Label}">
    <Style.Triggers>
        <Trigger Property="ns:PrintLib.IsReportMode" Value="True">
            <Setter Property="Visibility" Value="Collapsed" />
        </Trigger>
    </Style.Triggers>
</Style>




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


QuestionHow to have duplicate model/view-model in TabControl Pin
Leif Simon Goodwin21-Apr-16 2:01
Leif Simon Goodwin21-Apr-16 2:01 
AnswerRe: How to have duplicate model/view-model in TabControl Pin
Pete O'Hanlon21-Apr-16 3:57
mvePete O'Hanlon21-Apr-16 3:57 
GeneralRe: How to have duplicate model/view-model in TabControl Pin
Leif Simon Goodwin22-Apr-16 0:41
Leif Simon Goodwin22-Apr-16 0:41 
GeneralRe: How to have duplicate model/view-model in TabControl Pin
Pete O'Hanlon22-Apr-16 0:44
mvePete O'Hanlon22-Apr-16 0:44 
QuestionWPF App for video recording from webcam into file MP4/h.264 Pin
Qinitram13-Apr-16 23:33
Qinitram13-Apr-16 23:33 
AnswerRe: WPF App for video recording from webcam into file MP4/h.264 Pin
Gerry Schmitz17-Apr-16 19:31
mveGerry Schmitz17-Apr-16 19:31 
QuestionUserControl not displayed inside the parent window only in designer Pin
hesido9-Apr-16 0:18
hesido9-Apr-16 0:18 
QuestionLoading resources from XAML, problem with fonts Pin
Jayme655-Apr-16 10:17
Jayme655-Apr-16 10:17 
AnswerRe: Loading resources from XAML, problem with fonts Pin
Pete O'Hanlon5-Apr-16 21:49
mvePete O'Hanlon5-Apr-16 21:49 
QuestionCombox with Multi Column Header Pin
fratola29-Mar-16 8:08
fratola29-Mar-16 8:08 
AnswerRe: Combox with Multi Column Header Pin
Richard Deeming29-Mar-16 8:26
mveRichard Deeming29-Mar-16 8:26 
GeneralRe: Combox with Multi Column Header Pin
fratola31-Mar-16 20:26
fratola31-Mar-16 20:26 
Questionlistviewitem style Pin
caradri13-Mar-16 0:41
caradri13-Mar-16 0:41 
Questionxceed datagrid (community) and virtualization Pin
amigoface9-Mar-16 18:47
amigoface9-Mar-16 18:47 
AnswerRe: window application form work in KIOSK Pin
Pete O'Hanlon8-Feb-16 21:37
mvePete O'Hanlon8-Feb-16 21:37 
AnswerRe: window application form work in KIOSK Pin
Richard Deeming9-Feb-16 1:55
mveRichard Deeming9-Feb-16 1:55 
AnswerRe: window application form work in KIOSK Pin
ZurdoDev9-Feb-16 8:36
professionalZurdoDev9-Feb-16 8:36 

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.