<UserControl x:Class="ZknwSystems.WindFarmScada.UserControls.ComponentControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/up-compatibility/2006" x:Name="myControl"
xmlns:led="clr-namespace:StatusControl.LEDDisplays;assembly=ZknwStatusControlLibrary"
mc:Ignorable="d"
>
<ScrollViewer HorizontalAlignment="Left"
Height="{Binding Path=ControlHeight, ElementName=myControl}" BorderThickness="0" VerticalScrollBarVisibility="Auto">
</ScrollViewer >
</UserControl >直接 写里面 就好了。
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/up-compatibility/2006" x:Name="myControl"
xmlns:led="clr-namespace:StatusControl.LEDDisplays;assembly=ZknwStatusControlLibrary"
mc:Ignorable="d"
>
<ScrollViewer HorizontalAlignment="Left"
Height="{Binding Path=ControlHeight, ElementName=myControl}" BorderThickness="0" VerticalScrollBarVisibility="Auto">
</ScrollViewer >
</UserControl >直接 写里面 就好了。
usercontrol.Children.add(sv);