xmal:
<UserControl.Resources>
<Global:GlobalPara x:Key="GlobalPara"></Global:GlobalPara>
</UserControl.Resources>
<ItemsControl ItemsSource="{Binding Source={StaticResource GlobalPara},Path=属性名称}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
cs
private static ObservableCollection<WarehouseRuntime> warehouseRuntime = new ObservableCollection<WarehouseRuntime>();
/// <summary>
/// 运行时的仓库数据
/// </summary>
public static ObservableCollection<WarehouseRuntime> WarehouseRuntime
{
get => warehouseRuntime; set
{
warehouseRuntime = WarehouseRuntime;
//调用通知
StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(nameof(WarehouseRuntime)));
}
}
/// <summary>
/// 新建静态属性变更通知
/// </summary>
public static event EventHandler<PropertyChangedEventArgs> StaticPropertyChanged;