Click here to Skip to main content
15,886,919 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Event Handling Pin
Philipp Sumi8-May-09 6:41
Philipp Sumi8-May-09 6:41 
GeneralRe: Event Handling Pin
Nish Nishant8-May-09 6:57
sitebuilderNish Nishant8-May-09 6:57 
GeneralRe: Event Handling Pin
Philipp Sumi8-May-09 7:00
Philipp Sumi8-May-09 7:00 
AnswerRe: Event Handling Pin
Pete O'Hanlon9-May-09 0:37
mvePete O'Hanlon9-May-09 0:37 
QuestionCreate pixel dimensions of a text string Pin
califax2k8-May-09 5:02
califax2k8-May-09 5:02 
AnswerRe: Create pixel dimensions of a text string Pin
#realJSOP8-May-09 5:42
mve#realJSOP8-May-09 5:42 
GeneralRe: Create pixel dimensions of a text string Pin
califax2k10-May-09 21:24
califax2k10-May-09 21:24 
QuestionBasedOn Property Pin
#realJSOP8-May-09 2:52
mve#realJSOP8-May-09 2:52 
I'm looking at this problem again, and I still haven't been able to figure out why it's not working. I have a number of XAML files in a WPF UserControl library that contain various elements.

In Resources.XAML:

<ImageBrush x:Key="ImgBrushQuickLaunch" Stretch="Fill"
                      ImageSource="/MyResourcesLib;component/Images/GlassQuickLaunch64.png" />


In Styles.XAML:

<Style TargetType="{x:Type Button}" x:Key="StyleUDPButton">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Opacity" Value="0.40" />
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

<Style x:Key="StyleButtonQuickLaunch" TargetType="{x:Type Button}"
                 BasedOn="{StaticResource StyleUDPButton}">
        <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate>
                <Border CornerRadius="18" Background="{DynamicResource UDPQuickLaunch}">
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>


Finally, in the main application Window (in the main application), I'm doing this:

<Window x:Class="TestingPlatform.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300">
    <Grid>
        
        <Button Name="button1" Style="{DynamicResource StyleButtonQuickLaunch}" 
                Margin="60,58,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" 
                Height="37" Width="37"
                BorderThickness="0" BorderBrush="Transparent" />
    </Grid>
</Window>


My problem is that despite there being no errors or warnings, the button does not show up in either the designer, nor the running application. In fact, I can't get the button to show up at all unless the custom style isn't attached, even if I take off the BasedOn property.


"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
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


AnswerRe: BasedOn Property Pin
Pete O'Hanlon8-May-09 4:47
mvePete O'Hanlon8-May-09 4:47 
GeneralRe: BasedOn Property Pin
#realJSOP8-May-09 5:32
mve#realJSOP8-May-09 5:32 
AnswerRe: BasedOn Property Pin
Mark Salsbery8-May-09 7:45
Mark Salsbery8-May-09 7:45 
QuestionVideo Conferencing Application in wpf Pin
JS 20088-May-09 0:48
JS 20088-May-09 0:48 
AnswerRe: Video Conferencing Application in wpf Pin
Pete O'Hanlon8-May-09 1:02
mvePete O'Hanlon8-May-09 1:02 
AnswerRe: Video Conferencing Application in wpf Pin
Mark Salsbery8-May-09 7:37
Mark Salsbery8-May-09 7:37 
QuestionGenerate Dynamic XAML Pin
the_jat7-May-09 19:42
the_jat7-May-09 19:42 
AnswerRe: Generate Dynamic XAML Pin
Pete O'Hanlon7-May-09 22:32
mvePete O'Hanlon7-May-09 22:32 
QuestionCreate datetime, time and duration control? Pin
salon7-May-09 19:34
salon7-May-09 19:34 
Questiontype-ahead control in WPF Pin
GaneshSharma7-May-09 7:46
GaneshSharma7-May-09 7:46 
AnswerRe: type-ahead control in WPF Pin
sivaddrahcir18-May-09 13:58
sivaddrahcir18-May-09 13:58 
QuestionHow to set AutomationProperty to a WPF ListItem. Pin
tapas19797-May-09 7:00
tapas19797-May-09 7:00 
AnswerRe: How to set AutomationProperty to a WPF ListItem. Pin
tapas19797-May-09 7:02
tapas19797-May-09 7:02 
QuestionHelp needed regarding HeaderedContentControl Pin
Ravi Mori7-May-09 4:37
Ravi Mori7-May-09 4:37 
Question[Message Deleted] Pin
Cl@nd£$t|n07-May-09 0:42
Cl@nd£$t|n07-May-09 0:42 
AnswerRe: Widh & Height with percentage Pin
Pauwels Bart7-May-09 1:05
Pauwels Bart7-May-09 1:05 
QuestionSave the first page of a word as picture Pin
Prajeesh7-May-09 0:28
Prajeesh7-May-09 0:28 

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.