本文整理汇总了C#中Windows.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Windows.SetValue方法的具体用法?C# Windows.SetValue怎么用?C# Windows.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows
的用法示例。
在下文中一共展示了Windows.SetValue方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrepareContainerForItemOverride
protected override void PrepareContainerForItemOverride(Windows.UI.Xaml.DependencyObject element, object item)
{
i++;
MediaViewModel MediaViewModel;
ViewedVideoViewModel viewedVideo;
VLC_WINRT.ViewModels.MainPage.MusicLibraryViewModel.AlbumItem albumItem;
MediaViewModel = item as MediaViewModel;
viewedVideo = item as ViewedVideoViewModel;
albumItem = item as VLC_WINRT.ViewModels.MainPage.MusicLibraryViewModel.AlbumItem;
if (viewedVideo != null)
{
if (viewedVideo.Duration.TotalSeconds > viewedVideo.TimeWatched.TotalSeconds / 2 && i == 0)
{
element.SetValue(VariableSizedWrapGrid.ColumnSpanProperty, 2);
element.SetValue(VariableSizedWrapGrid.RowSpanProperty, 2);
}
}
else if (MediaViewModel != null || albumItem != null)
{
if (i == 0)
{
element.SetValue(VariableSizedWrapGrid.ColumnSpanProperty, 2);
element.SetValue(VariableSizedWrapGrid.RowSpanProperty, 2);
}
}
base.PrepareContainerForItemOverride(element, item);
}
示例2: PrepareContainerForItemOverride
protected override void PrepareContainerForItemOverride(Windows.UI.Xaml.DependencyObject element, object item)
{
var viewModel = item as SampleDataItem;
element.SetValue(VariableSizedWrapGrid.ColumnSpanProperty,viewModel.ColSpan);
element.SetValue(VariableSizedWrapGrid.RowSpanProperty, viewModel.RowSpan);
base.PrepareContainerForItemOverride(element, item);
}
示例3: PrepareContainerForItemOverride
protected override void PrepareContainerForItemOverride(Windows.UI.Xaml.DependencyObject element, object item)
{
MediaItem media = item as MediaItem;
element.SetValue(VariableSizedWrapGrid.ColumnSpanProperty, media.Width);
element.SetValue(VariableSizedWrapGrid.RowSpanProperty, media.Height);
base.PrepareContainerForItemOverride(element, item);
}
示例4: PrepareContainerForItemOverride
protected override void PrepareContainerForItemOverride(Windows.UI.Xaml.DependencyObject element, object item)
{
base.PrepareContainerForItemOverride(element, item);
if (item != null)
{
var span = 1;
var projectInformationModel = item as ProjectInformationModel;
if (projectInformationModel != null)
{
span = projectInformationModel.Status == 1 ? 2 : 1;
}
element.SetValue(VariableSizedWrapGrid.RowSpanProperty, span);
element.SetValue(VariableSizedWrapGrid.ColumnSpanProperty, span);
}
}
示例5: PrepareContainerForItemOverride
protected override void PrepareContainerForItemOverride(Windows.UI.Xaml.DependencyObject element, object item)
{
try
{
dynamic _Item = item;
element.SetValue(VariableSizedWrapGrid.ColumnSpanProperty, _Item.ColSpan);
element.SetValue(VariableSizedWrapGrid.RowSpanProperty, _Item.RowSpan);
}
catch
{
element.SetValue(VariableSizedWrapGrid.ColumnSpanProperty, 1);
element.SetValue(VariableSizedWrapGrid.RowSpanProperty, 1);
}
finally
{
base.PrepareContainerForItemOverride(element, item);
}
}
示例6: PrepareContainerForItemOverride
protected override void PrepareContainerForItemOverride(Windows.UI.Xaml.DependencyObject element, object item)
{
try
{
dynamic _Item = item;
element.SetValue(Windows.UI.Xaml.Controls.GridViewItem.WidthProperty, _Item.ColSpan);
element.SetValue(Windows.UI.Xaml.Controls.GridViewItem.HeightProperty, _Item.RowSpan);;
element.SetValue(Windows.UI.Xaml.Controls.VariableSizedWrapGrid.ColumnSpanProperty, _Item.ColSpan);
element.SetValue(Windows.UI.Xaml.Controls.VariableSizedWrapGrid.RowSpanProperty, _Item.RowSpan);
}
catch
{
throw new Exception("Unable to set ColSpan or RowSpan from Item");
}
finally
{
base.PrepareContainerForItemOverride(element, item);
}
}
示例7: PrepareContainerForItemOverride
protected override void PrepareContainerForItemOverride(Windows.UI.Xaml.DependencyObject element, object item)
{
try
{
if (item is IVariableGridSize)
{
dynamic _Item = item;
element.SetValue(VariableSizedWrapGrid.ColumnSpanProperty, _Item.ColumnSpan);
element.SetValue(VariableSizedWrapGrid.RowSpanProperty, _Item.RowSpan);
}
}
catch // Ignoring Exceptions here is by design
{
element.SetValue(VariableSizedWrapGrid.ColumnSpanProperty, 1);
element.SetValue(VariableSizedWrapGrid.RowSpanProperty, 1);
}
finally
{
base.PrepareContainerForItemOverride(element, item);
}
}
示例8: PrepareContainerForItemOverride
protected override void PrepareContainerForItemOverride(Windows.UI.Xaml.DependencyObject element, object item)
{
if (item.GetType() == typeof(HubPageDataItem))
{
var viewModel = item as HubPageDataItem;
element.SetValue(VariableSizedWrapGrid.ColumnSpanProperty, viewModel.ColSpan);
element.SetValue(VariableSizedWrapGrid.RowSpanProperty, viewModel.RowSpan);
base.PrepareContainerForItemOverride(element, item);
}
else if (item.GetType() == typeof(SpokeDataItem))
{
var viewModel = item as SpokeDataItem;
element.SetValue(VariableSizedWrapGrid.ColumnSpanProperty, viewModel.ColSpan);
element.SetValue(VariableSizedWrapGrid.RowSpanProperty, viewModel.RowSpan);
base.PrepareContainerForItemOverride(element, item);
}
else if (item.GetType() == typeof(DetailDataItem))
{
var viewModel = item as DetailDataItem;
element.SetValue(VariableSizedWrapGrid.ColumnSpanProperty, viewModel.ColSpan);
element.SetValue(VariableSizedWrapGrid.RowSpanProperty, viewModel.RowSpan);
base.PrepareContainerForItemOverride(element, item);
}
}
示例9: PrepareContainerForItemOverride
protected override void PrepareContainerForItemOverride(Windows.UI.Xaml.DependencyObject element, object item)
{
//try
//{
// dynamic _Item = item;
// element.SetValue(Windows.UI.Xaml.Controls.VariableSizedWrapGrid.ColumnSpanProperty, _Item.ColSpan);
// element.SetValue(Windows.UI.Xaml.Controls.VariableSizedWrapGrid.RowSpanProperty, _Item.RowSpan);
//}
//catch
//{
// element.SetValue(Windows.UI.Xaml.Controls.VariableSizedWrapGrid.ColumnSpanProperty, 1);
// element.SetValue(Windows.UI.Xaml.Controls.VariableSizedWrapGrid.RowSpanProperty, 1);
//}
//finally
//{
// base.PrepareContainerForItemOverride(element, item);
//}
//Dynamically Loaded The VariableSizeWrapGrid
try
{
dynamic dynamic = item;
element.SetValue(Windows.UI.Xaml.Controls.VariableSizedWrapGrid.ColumnSpanProperty, dynamic.ColSpan);
element.SetValue(Windows.UI.Xaml.Controls.VariableSizedWrapGrid.RowSpanProperty, dynamic.RowSpan);
}
catch
{
element.SetValue(Windows.UI.Xaml.Controls.VariableSizedWrapGrid.ColumnSpanProperty, 1);
element.SetValue(Windows.UI.Xaml.Controls.VariableSizedWrapGrid.RowSpanProperty, 1);
}
finally
{
base.PrepareContainerForItemOverride(element,item);
}
}
示例10: PrepareContainerForItemOverride
protected override void PrepareContainerForItemOverride(Windows.UI.Xaml.DependencyObject element, object item)
{
if (item != null)
{
int iColumnSpan = 1;
GridItemColumnSpan gridItemColumnSpan = item.GetCustomAttribute<GridItemColumnSpan>();
if (gridItemColumnSpan != null)
{
iColumnSpan = gridItemColumnSpan.ColumnSpan;
}
int iRowSpan = 1;
GridItemRowSpan gridItemRowSpan = item.GetCustomAttribute<GridItemRowSpan>();
if (gridItemRowSpan != null)
{
iRowSpan = gridItemRowSpan.RowSpan;
}
element.SetValue(Windows.UI.Xaml.Controls.VariableSizedWrapGrid.ColumnSpanProperty, iColumnSpan);
element.SetValue(Windows.UI.Xaml.Controls.VariableSizedWrapGrid.RowSpanProperty, iRowSpan);
}
base.PrepareContainerForItemOverride(element, item);
}
示例11: SetRealTimeText
public static void SetRealTimeText( Windows.UI.Xaml.Controls.TextBox obj, string value )
{
obj.SetValue ( RealTimeTextProperty, value );
}
示例12: SetIsAutoUpdate
public static void SetIsAutoUpdate( Windows.UI.Xaml.Controls.TextBox obj, bool value )
{
obj.SetValue ( IsAutoUpdateProperty, value );
}
示例13: SetPolygonProperties
private void SetPolygonProperties(Windows.UI.Xaml.Shapes.Polygon polygon)
{
polygon.SetValue(Grid.RowProperty, _row);
polygon.SetValue(Grid.ColumnProperty, _column);
polygon.Fill = ColorGenerator.GetRandomColor(ColorScheme.Purple);
polygon.Opacity = .4f;
}