Vous n’êtes pas connecté.
Saint
Junior Member
![]() |
Code source |
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 |
<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> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <!--Simpe databinding example--> <!--1. set up connection for this item (ie. temperature sensor)--> <!--2. bind values to your own usercontrol--> <!--Binding example--> <!--Content="{Binding ElementName=this, Path=DataContext.Value, FallbackValue=no data available}"--> <!--default background--> <Rectangle Grid.Row="0" Grid.RowSpan="2" Style="{StaticResource GadgetBackgroundStyle}"/> <!--Content: binding to source value: --> <!--Content: ElementName=this --> <!--Content: Path=DataContext.Value, for connetion to actual connected value --> <TextBlock Text="{Binding ElementName=this, Path=DataContext.Value, FallbackValue=no data available}" Grid.Row="0" Opacity="1.0" Height="Auto" Width="Auto" Foreground="#FF000000" FontSize="15" FontFamily="Segoe UI" FontWeight="Normal" Margin="0,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" /> <!--Content: binding to source value: --> <!--Content: ElementName=this --> <!--Content: Path=DataContext.DataName, for connetion to actual connected value name --> <TextBlock Text="{Binding ElementName=this, Path=DataContext.DataName, FallbackValue=no data available}" Grid.Row="1" Opacity="1.0" Height="Auto" Width="Auto" Foreground="#FF000000" FontSize="15" FontFamily="Segoe UI" FontWeight="Normal" Margin="0,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" /> </Grid> </UserControl> |
![]() |
Code source |
1 |
CPU 4% | 38°C | 29,3W |
Ce message a été modifié 3 fois. Dernière modification effectuée par "Saint" (15 août 2019, 20:44)
Ce message a été modifié 1 fois. Dernière modification effectuée par "Taubenhaucher" (22 août 2019, 19:15)
warum nicht, es gibt ja auch genug vorlagen die man modifizieren kann.das bei rund 500 Leuten noch keiner die Funktion
Saint
Junior Member
du kannst je Element nur eine Datenquelle verbinden.
es gibt auch eine Datei mit Templaten wenn du eine vorlage importierst, da findest du auch viele Beisppiele mit individuellem XAML code.
Sonst stelle deine Frage konkreter. Was geht nicht? Hast du Dir schon mal alle vorlagen angeschaut. Da muss man auch mal ein wenig mit experimentieren. Du wirst niemand finden der dir das so macht wie du es haben willst.
Na gut, dann wollen Dich wohl alle 470 Threadanschauer dissen!?
Jetzt mal ehrlich, wie wahrscheinlich ist das
Manchmal sind die Dinge einfach wie sie sind, ohne Hintergedanken, auch wenn man es gerne anders hätte![]()
Ce message a été modifié 2 fois. Dernière modification effectuée par "Saint" (23 août 2019, 13:31)
du kannst EINE Datenquelle pro Element verwenden.man kann aber doch sicher mehrere elemente davon in eine tabelle bekommen oder nicht ?
Saint
Junior Member
![]() |
Code source |
1 |
DataContext.Value |
![]() |
Code source |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<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> <TextBlock Text="{Binding ElementName=this, Path=DataContext.Value, FallbackValue=no data available}" Foreground="White" FontSize="15"/> </Grid> </UserControl> |
Saint
Junior Member
![]() |
Code source |
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 |
<?xml version="1.0" encoding="utf-8"?> <SettingsGroup xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Name>Page</Name> <GridSize>10</GridSize> <Items> <SettingsBase xsi:type="SettingsXamlItem"> <X>310</X> <Y>210</Y> <Height>40</Height> <Width>90</Width> <ZOrder>1</ZOrder> <Opacity>1</Opacity> <SnapToGrid>true</SnapToGrid> <GridSize>10</GridSize> <connection>service_data:1:data\sensor\aquamonitor//cpu/0/temperature/0_0</connection> <itemType>XamlControl</itemType> <font> <size>22</size> <w>Normal</w> <st>Normal</st> <f>Segoe UI</f> <col>#ff000000</col> </font> <xamlCode><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> <TextBlock Text="{Binding ElementName=this, Path=DataContext.Value, FallbackValue=no data available}" Foreground="White" FontSize="15"/> </Grid> </UserControl></xamlCode> </SettingsBase> </Items> </SettingsGroup> |
![]() |
Code source |
1 |
<connection>service_data:1:data\sensor\aquamonitor//cpu/0/temperature/0_0</connection> |
![]() |
Code source |
1 |
Text="{Binding ElementName=this, Path=service_data:1:data\sensor\aquamonitor//cpu/0/temperature/0_0, FallbackValue=no data available}" |
Citation
service_data:1:data\sensor\aquamonitor//cpu/0/temperature/0_0
Ce message a été modifié 1 fois. Dernière modification effectuée par "Saint" (23 août 2019, 15:12)
das geht nicht.Text="{Binding ElementName=this, Path=service_data:1:data\sensor\aquamonitor//cpu/0/temperature/0_0, FallbackValue=no data available}"
![]() |
Code source |
1 |
service_data:1:data\sensor\aquamonitor//cpu/0/temperature/0_0 |
-