• 19.09.2019, 23:33
  • Register
  • Login
  • You are not logged in.

 

Dear visitor, welcome to Aqua Computer Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

FlorianG

Junior Member

Aquasuite XML Frage

Friday, November 16th 2018, 8:48pm

Hallo,

ich habe seit dem Update 18-6 das Problem dass ich bei einigen Elementen die Schriftfarbe nicht mehr ändern kann, bzw das diese sich nach dem Update auf Weiß eingestellt hat.

Kann hier mal jemand drüber schauen und mir sagen wo ich was ändern muss.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<UserControl
    x:Name="this"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <!--Simple databinding example-->
        <!--1. set up connection for this item (ie. temperature sensor) -->
        <!--2. bind values to your own user control-->
        <!--3. use data trigger and converter to switch properties-->

        <!--Usage of Converter:-->
        <!--The Converter returns True or False-->
        <!--The Converter needs a ConverterParameter to compare the value-->        
        <!--Use Binding with Converter:-->
        <!--Binding="{Binding ElementName=this, Path=DataContext.Value, ConverterParameter=27, Converter={StaticResource CompareSmalerConverter}}"-->
        <!--Available Converters:-->
        <!--CompareSmallerConverter: true if bound value smaller than ConverterParameter-->
        <!--CompareGreaterEqualConverter: true if bound value bigger or equal to ConverterParameter-->
        <!--CompareEqualConverter: true if bound value is equal to ConverterParameter-->



        <!--text-->
        <!--Content: do not define this property-->
        <!--this is defined when you define the style trigger-->
<Label
            Opacity="1.0"
            Height="Auto" 
            Width="Auto"
            Foreground="#000000"
            FontSize="32"
            FontFamily="BigNoodleTitling"
            FontWeight="Normal"                    
            Margin="0,0,0,0" 
            Padding="0,0,0,0"
            HorizontalAlignment="Center" 
            VerticalAlignment="Center">
            <Label.Style>
                <Style TargetType="{x:Type Label}">
                    <Style.Triggers>                        
                        <DataTrigger 
                            Value="True" 
                            Binding="{Binding ElementName=this, Path=DataContext.Value, ConverterParameter=25, Converter={StaticResource CompareSmallerConverter}}">
                            <Setter Property="Content" Value="Grafikspeicher Leer"/>
                        </DataTrigger>
                        
                        <DataTrigger 
                            Value="True" 
                            Binding="{Binding ElementName=this, Path=DataContext.Value, ConverterParameter=25, Converter={StaticResource CompareGreaterEqualConverter}}">
                            <Setter Property="Content" Value="Grafikspeicher OK"/>
                        </DataTrigger>
                        
                        <DataTrigger 
                            Value="True" 
                            Binding="{Binding ElementName=this, Path=DataContext.Value, ConverterParameter=50, Converter={StaticResource CompareGreaterEqualConverter}}">
                            <Setter Property="Content" Value="Grafikspeicher OK"/>
                        </DataTrigger>
                        
                        <DataTrigger 
                            Value="True" 
                            Binding="{Binding ElementName=this, Path=DataContext.Value, ConverterParameter=90, Converter={StaticResource CompareGreaterEqualConverter}}">
                            <Setter Property="Content" Value="Grafikspeicher Voll"/>
                        </DataTrigger>
                    </Style.Triggers>                    
                </Style>
            </Label.Style>
        </Label>
        
        
    </Grid>
</UserControl>


Vielen Dank schonmal

Shoggy

Sven - Admin

Friday, November 16th 2018, 9:22pm

"Textblock" statt "Label" verwenden ;)

Ggf. über die benutzerdefinierten Elemente einfach mal den Beispiel Code für Text in den Editor laden. Den kannst du als Vorlage nutzen.

FlorianG

Junior Member

Friday, November 16th 2018, 10:49pm

Danke, die Lösung lag so nahe :)

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<UserControl
    x:Name="this"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <!--Simple databinding example-->
        <!--1. set up connection for this item (ie. temperature sensor) -->
        <!--2. bind values to your own user control-->
        <!--3. use data trigger and converter to switch properties-->

        <!--Usage of Converter:-->
        <!--The Converter returns True or False-->
        <!--The Converter needs a ConverterParameter to compare the value-->
        <!--Use Binding with Converter:-->
        <!--Binding="{Binding ElementName=this, Path=DataContext.Value, ConverterParameter=27, Converter={StaticResource CompareSmalerConverter}}"-->
        <!--Available Converters:-->
        <!--CompareSmallerConverter: true if bound value smaller than ConverterParameter-->
        <!--CompareGreaterEqualConverter: true if bound value bigger or equal to ConverterParameter-->
        <!--CompareEqualConverter: true if bound value is equal to ConverterParameter-->

        
        <!--text-->
        <!--Content: do not define this property-->
        <!--this is defined when you define the style trigger-->
        <TextBlock
            Opacity="1.0"
            Height="Auto"
            Width="Auto"
            Foreground="#000000"
            FontSize="32"
            FontFamily="BigNoodleTitling"
            FontWeight="Normal"
            Margin="0,0,0,0"
            Padding="0,0,0,0"
            HorizontalAlignment="Center"
            VerticalAlignment="Center">
            <TextBlock.Style>
                <Style TargetType="{x:Type TextBlock}">
                    <Style.Triggers>
                        <DataTrigger
                            Value="True"
                            Binding="{Binding ElementName=this, Path=DataContext.Value, ConverterParameter=25, Converter={StaticResource CompareSmallerConverter}}">
                            <Setter Property="Text" Value="Grafikspeicher Leer"/>
                        </DataTrigger>

                        <DataTrigger
                            Value="True"
                            Binding="{Binding ElementName=this, Path=DataContext.Value, ConverterParameter=25, Converter={StaticResource CompareGreaterEqualConverter}}">
                            <Setter Property="Text" Value="Grafikspeicher -50%"/>
                        </DataTrigger>

                        <DataTrigger
                            Value="True"
                            Binding="{Binding ElementName=this, Path=DataContext.Value, ConverterParameter=50, Converter={StaticResource CompareGreaterEqualConverter}}">
                            <Setter Property="Text" Value="Grafikspeicher +50%"/>
                        </DataTrigger>

                        <DataTrigger
                            Value="True"
                            Binding="{Binding ElementName=this, Path=DataContext.Value, ConverterParameter=90, Converter={StaticResource CompareGreaterEqualConverter}}">
                            <Setter Property="Text" Value="Grafikspeicher Voll"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </TextBlock.Style>
        </TextBlock>


    </Grid>
</UserControl>