本文整理汇总了C#中Windows.UI.Xaml.Controls.Border类的典型用法代码示例。如果您正苦于以下问题:C# Border类的具体用法?C# Border怎么用?C# Border使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Border类属于Windows.UI.Xaml.Controls命名空间,在下文中一共展示了Border类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnNavigatedTo
protected override void OnNavigatedTo(NavigationEventArgs e)
{
/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached. The Parameter
/// property is typically used to configure the page.</param>
///
try
{
argument = (int)e.Parameter;
}
catch (Exception e1)
{ }
string savedBackgroundImageName = App.backgroundImage;
if (savedBackgroundImageName != null)
{
savedBackgroundImageName = savedBackgroundImageName.Split('.')[0];
if (savedBackgroundImageName != "")
{
Image savedBackgroundImageInstance = (Image)FindName(savedBackgroundImageName);
savedBackgroundImageInstance.Opacity = 0.6;
newSelectedImage = savedBackgroundImageInstance;
Border bb = (Border)FindName("bb" + savedBackgroundImageName);
bb.BorderBrush = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Gray);
previouslySelect = bb;
//BottomAppBar.IsOpen = true;
}
}
}
开发者ID:Chengxuan,项目名称:MuslimSuitePro,代码行数:34,代码来源:ChangeBGSnapped.xaml.cs
示例2: GenerateTileImagesAsyncInternal
private static async Task GenerateTileImagesAsyncInternal(Border mediumTileHost, Border wideTileHost, TileSettings settings)
{
var tileModel = await TileModelBuilder.BuildTileModelAsync(settings);
await TileImageGenerator.GenerateMediumTileImageFileAsync(tileModel, mediumTileHost);
await TileImageGenerator.GenerateWideTileImageFileAsync(tileModel, wideTileHost);
}
开发者ID:shaftware,项目名称:CalendarTile,代码行数:7,代码来源:TileManager.cs
示例3: Create_Cells
private void Create_Cells()
{
_borders = new List<Border>();
_values = new List<TextBlock>();
for (int row = 0; row < 9; row++)
{
for (int col = 0; col < 9; col++)
{
var cell = new TextBlock();
Grid.SetRow(cell, row);
Grid.SetColumn(cell, col);
var border = new Border { BorderBrush = new SolidColorBrush(Colors.White), BorderThickness = new Thickness(1), Background = new SolidColorBrush(Colors.Black) };
border.Tapped += Cell_Tapped;
Grid.SetRow(border, row);
Grid.SetColumn(border, col);
var viewBox = new Viewbox();
Grid.SetRow(viewBox, row);
Grid.SetColumn(viewBox, col);
SudokuSolverGrid.Children.Add(viewBox);
SudokuSolverGrid.Children.Add(border);
viewBox.Child = cell;
}
}
_values = SudokuSolverGrid.Children.Where(c => c is Viewbox).Select(c => (TextBlock)((Viewbox)c).Child).ToList();
_borders = SudokuSolverGrid.Children.Where(c => c is Border).Select(c => (Border)c).ToList();
}
开发者ID:Kanac,项目名称:Sudoku-Solver-and-Generator-Universal-8.1-App,代码行数:33,代码来源:SudokuSolver.xaml.cs
示例4: InitializeComponent
public void InitializeComponent()
{
if (_contentLoaded)
return;
_contentLoaded = true;
Application.LoadComponent(this, new System.Uri("ms-appx:///SplitPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
pageRoot = (NoelBlogReader.Common.LayoutAwarePage)this.FindName("pageRoot");
itemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("itemsViewSource");
primaryColumn = (Windows.UI.Xaml.Controls.ColumnDefinition)this.FindName("primaryColumn");
titlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("titlePanel");
itemListScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer");
itemDetail = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemDetail");
itemDetailGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("itemDetailGrid");
itemTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("itemTitle");
contentViewBorder = (Windows.UI.Xaml.Controls.Border)this.FindName("contentViewBorder");
contentView = (Windows.UI.Xaml.Controls.WebView)this.FindName("contentView");
contentViewRect = (Windows.UI.Xaml.Shapes.Rectangle)this.FindName("contentViewRect");
itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView");
backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
FullScreenPortrait_Detail = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait_Detail");
Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
Snapped_Detail = (Windows.UI.Xaml.VisualState)this.FindName("Snapped_Detail");
}
开发者ID:noelitoa,项目名称:WinRT---Blog-Reader,代码行数:29,代码来源:SplitPage.g.i.cs
示例5: OnApplyTemplate
protected override void OnApplyTemplate()
{
base.OnApplyTemplate();
// make sure we listen at the right time to add/remove the back button event handlers
if(_backButton != null)
{
_backButton.Tapped -= OnBackButtonTapped;
}
_backButton = GetTemplateChild("SettingsBackButton") as Button;
if(_backButton != null)
{
_backButton.Tapped += OnBackButtonTapped;
}
// need to get these grids in order to set the offsets correctly in RTL situations
if (_contentGrid == null)
{
_contentGrid = GetTemplateChild("SettingsFlyoutContentGrid") as Grid;
}
_contentGrid.Transitions = new TransitionCollection();
_contentGrid.Transitions.Add(new EntranceThemeTransition()
{
FromHorizontalOffset = (SettingsPane.Edge == SettingsEdgeLocation.Right) ? CONTENT_HORIZONTAL_OFFSET : (CONTENT_HORIZONTAL_OFFSET * -1)
});
// need the root border for RTL scenarios
_rootBorder = GetTemplateChild("PART_RootBorder") as Border;
// need the content scrollviewer to set the fixed width to be the same size as flyout
_contentScrollViewer = GetTemplateChild("PART_ContentScrollViewer") as ScrollViewer;
}
开发者ID:scottdorman,项目名称:callisto,代码行数:33,代码来源:SettingsFlyout.cs
示例6: ListPage
//-------------------------------------------------------------------------------
#endregion (Util)
//-------------------------------------------------------------------------------
#region Constructor
//-------------------------------------------------------------------------------
//
public ListPage()
{
this.InitializeComponent();
this.navigationHelper = new NavigationHelper(this);
this.navigationHelper.LoadState += navigationHelper_LoadState;
this.navigationHelper.SaveState += navigationHelper_SaveState;
CANVASES = new Canvas[] {
canvasMap1_E123, canvasMap1_E456, canvasMap1_W,
canvasMap2_E123, canvasMap2_E456, canvasMap2_W,
canvasMap3_E123, canvasMap3_E456, canvasMap3_W
};
SCROLLVIEWERS = new ScrollViewer[] {
scImgMap1_E123, scImgMap1_E456, scImgMap1_W,
scImgMap2_E123, scImgMap2_E456, scImgMap2_W,
scImgMap3_E123, scImgMap3_E456, scImgMap3_W
};
SELECT_BORDERS = new Border[] {
borderMap1_E123, borderMap1_E456, borderMap1_W,
borderMap2_E123, borderMap2_E456, borderMap2_W,
borderMap3_E123, borderMap3_E456, borderMap3_W
};
RADIOBUTTONS = new RadioButton[] {
rbSearch_Checklist, rbSearch_SearchString, rbSearch_Genre
};
}
开发者ID:kavenblog,项目名称:ComicStarViewer,代码行数:33,代码来源:ListPage.xaml.cs
示例7: AddItemButton_Click
private void AddItemButton_Click(object sender, RoutedEventArgs e)
{
if (RepositionItemsContainer.Items != null && RepositionItemsContainer.Items.Count > 0)
{
int itemPosition = rand.Next(0, RepositionItemsContainer.Items.Count);
int randomImage = rand.Next(0, 17);
var item = new Image
{
Source = new BitmapImage
{
UriSource = new Uri("ms-appx:///Images/LandscapeImage" + randomImage.ToString() + ".jpg", UriKind.Absolute)
},
Width = 200,
Height = 134
};
var border = new Border
{
BorderBrush = new SolidColorBrush(Color.FromArgb(112, 255, 255, 255)),
BorderThickness = new Thickness(1),
Margin = new Thickness(4),
Child = item
};
RepositionItemsContainer.Items.Insert(itemPosition, border);
}
}
开发者ID:a7an,项目名称:win10exploration,代码行数:29,代码来源:MainPage.xaml.cs
示例8: OnPathChanged
private static void OnPathChanged( DependencyObject obj, DependencyPropertyChangedEventArgs args )
{
var icon = (Icon) obj;
var data = (string) args.NewValue;
if ( data == null )
{
return;
}
// Copy it since sharing it isn't permitted
var path = (Path) XamlReader.Load( "<Path xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" Data=\"" + data + "\" />" );
path.Stretch = Stretch.Uniform;
path.HorizontalAlignment = HorizontalAlignment.Center;
path.VerticalAlignment = VerticalAlignment.Center;
path.SetBinding( Path.FillProperty, new Binding { Source = icon, Path = new PropertyPath( "Foreground" ) } );
path.SetBinding( Path.MarginProperty, new Binding { Source = icon, Path = new PropertyPath( "Padding" ) } );
var container = new Border
{
Child = path
};
container.SetBinding( Border.WidthProperty, new Binding { Source = icon, Path = new PropertyPath( "IconWidth" ) } );
container.SetBinding( Border.HeightProperty, new Binding { Source = icon, Path = new PropertyPath( "IconHeight" ) } );
container.SetBinding( Border.BackgroundProperty, new Binding { Source = icon, Path = new PropertyPath( "Background" ) } );
icon.HorizontalAlignment = HorizontalAlignment.Center;
icon.VerticalAlignment = VerticalAlignment.Center;
icon.Content = new Viewbox
{
Child = container
};
}
开发者ID:ValentinMinder,项目名称:pocketcampus,代码行数:34,代码来源:Icon.cs
示例9: OnNavigatedTo
protected override void OnNavigatedTo(NavigationEventArgs e)
{
try
{
argument = (int)e.Parameter;
}
catch (Exception e1) { }
string savedBackgroundImageName = App.backgroundImage;
if (savedBackgroundImageName != null)
{
savedBackgroundImageName = savedBackgroundImageName.Split('.')[0];
if (savedBackgroundImageName != "")
{
Image savedBackgroundImageInstance = (Image)FindName(savedBackgroundImageName);
savedBackgroundImageInstance.Opacity = 0.6;
newSelectedImage = savedBackgroundImageInstance;
Border bb = (Border)FindName("bb" + savedBackgroundImageName);
bb.BorderBrush = new Windows.UI.Xaml.Media.SolidColorBrush(Windows.UI.Colors.Gray);
previouslySelect = bb;
//BottomAppBar.IsOpen = true;
}
}
}
开发者ID:Chengxuan,项目名称:MuslimSuitePro,代码行数:26,代码来源:ChangeBackground.xaml.cs
示例10: FlyAlert
/// <summary>
/// 사용 X
/// </summary>
public static void FlyAlert()
{
Flyout f = new Flyout();
Border b = new Border();
b.Width = 300;
b.Height = 125;
TextBlock tb = new TextBlock();
tb.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Center;
tb.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Center;
tb.TextWrapping = TextWrapping.Wrap;
tb.FontSize = 24.667;
tb.Text = "This is a basic ContentControl so put anything you want in here.";
b.Child = tb;
f.Content = b;
f.Placement = (PlacementMode)Enum.Parse(typeof(PlacementMode), "Top");
//f.PlacementTarget = sender as UIElement;
f.IsOpen = true;
ObjectTracker.Track(f);
}
开发者ID:huinalam,项目名称:WinRTRadioRss,代码行数:29,代码来源:FlyMenu.cs
示例11: init
void init()
{
Background = new SolidColorBrush(Colors.Transparent);
VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top;
HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Left;
_transform = new CompositeTransform();
_c_transform = new CompositeTransform();
RenderTransform = _transform;
//scroll
_scroll = new ScrollViewer()
{
HorizontalScrollMode = ScrollMode.Enabled,
VerticalScrollMode = ScrollMode.Enabled,
HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden,
VerticalScrollBarVisibility = ScrollBarVisibility.Hidden
};
Children.Add(_scroll);
//content
_content = new Grid() { HorizontalAlignment = HorizontalAlignment.Left, ManipulationMode = ManipulationModes.All };
_content.RenderTransform = _c_transform;
_image = new Image() { Stretch = Stretch.UniformToFill };
_border = new Border() { CornerRadius = new Windows.UI.Xaml.CornerRadius(10) };
_content.Children.Add(_image);
_content.Children.Add(_border);
_scroll.Content = _content;
}
开发者ID:Milton761,项目名称:mLearningCoreEN,代码行数:27,代码来源:AnimatedBorderImage.cs
示例12: ShowMessage
// Unused and untested
public static void ShowMessage(string message, UIElement placementTarget, PlacementMode placementMode=PlacementMode.Top)
{
var f = new Callisto.Controls.Flyout();
var b = new Border()
{
Width = 300,
Height = 125
};
TextBlock tb = new TextBlock();
tb.HorizontalAlignment = HorizontalAlignment.Center;
tb.VerticalAlignment = VerticalAlignment.Center;
tb.TextWrapping = TextWrapping.Wrap;
tb.FontSize = 12f;
tb.Text = message;
b.Child = tb;
f.Content = b;
f.Placement = placementMode;
f.PlacementTarget = placementTarget;
f.IsOpen = true;
}
开发者ID:christophwille,项目名称:Sprudelsuche,代码行数:27,代码来源:MessageService.cs
示例13: Add
public virtual void Add(UIElement control)
{
int rows = _grid.RowDefinitions.Count;
_grid.RowDefinitions.Add(new RowDefinition());
var textBlock = new TextBlock
{
Text = ListItemPrefix,
Margin = new Thickness(0, 5, 0, 5),
HorizontalAlignment = HorizontalAlignment.Center
};
Grid.SetColumn(textBlock, 0);
Grid.SetRow(textBlock, rows);
_grid.Children.Add(textBlock);
if ((control is FrameworkElement) == false)
{
// UIElement can set column and row,
// so use a border.
var border = new Border
{
Child = control
};
control = border;
}
Grid.SetColumn((FrameworkElement)control, 1);
Grid.SetRow((FrameworkElement)control, rows);
_grid.Children.Add(control);
}
开发者ID:sahirmemon,项目名称:SoftwareKobo.HtmlRender,代码行数:29,代码来源:ListContainer.cs
示例14: showPopup_Click
private void showPopup_Click(object sender, RoutedEventArgs e)
{
// Create some content to show in the popup. Typically you would // create a user control.
Border border = new Border();
border.BorderThickness = new Thickness(5.0);
StackPanel panel1 = new StackPanel();
Button button1 = new Button();
button1.Content = "Close";
button1.Margin = new Thickness(5.0);
button1.Click += new RoutedEventHandler(button1_Click);
TextBlock textblock1 = new TextBlock();
textblock1.Text = "The popup control";
textblock1.Margin = new Thickness(5.0);
panel1.Children.Add(textblock1);
panel1.Children.Add(button1);
border.Child = panel1;
MoviePlayer MovieFrame = new MoviePlayer(ref p);
// Set the Child property of Popup to the border // which contains a stackpanel, textblock and button.
p.Child = MovieFrame;
// Set where the popup will show up on the screen.
p.VerticalOffset = 110;
p.HorizontalOffset = 0;
// Open the popup.
p.IsLightDismissEnabled = true;
p.IsOpen = true;
}
开发者ID:alexsb92,项目名称:TheMovieTrailerApp,代码行数:32,代码来源:StartPage.xaml.cs
示例15: BubbleContent
public BubbleContent(Bubble parent, string text = "")
{
this.parent = parent;
double radius = parent.getRadius();
textblock = new TextBlock()
{
Text = text,
Foreground = new SolidColorBrush(ColorSettings.TextColor),
TextAlignment = Windows.UI.Xaml.TextAlignment.Center,
FontSize = Preferences.FontSize,
FontFamily = Preferences.FontFamily,
Width = radius * 2,
MaxHeight = radius * 2,
TextWrapping = TextWrapping.WrapWholeWords,
TextTrimming = TextTrimming.CharacterEllipsis,
VerticalAlignment = VerticalAlignment.Center,
};
textcontainer = new Border()
{
Height = radius * 2,
Child = textblock,
};
BubbleContainer.canvas.Children.Add(textcontainer);
Canvas.SetZIndex(textcontainer, Int16.MaxValue);
}
开发者ID:patrickgh3,项目名称:fishbowl,代码行数:25,代码来源:BubbleContent.cs
示例16: GroupBoxContainer
public GroupBoxContainer(Span span)
{
var grid = new Grid();
grid.RowDefinitions.Add(new RowDefinition
{
Height = GridLength.Auto
});
grid.RowDefinitions.Add(new RowDefinition());
_titleBlock = new TextBlock();
grid.Children.Add(_titleBlock);
var border = new Border
{
BorderBrush = new SolidColorBrush(Colors.Gray),
BorderThickness = new Thickness(1, 0, 0, 1),
Margin = new Thickness(5, 0, 0, 5),
Padding = new Thickness(3, 0, 0, 3)
};
Grid.SetRow(border, 1);
grid.Children.Add(border);
var richTextBlock = new RichTextBlock()
{
IsTextSelectionEnabled = false
};
border.Child = richTextBlock;
_innerContainer = new RichTextBlockContainer(richTextBlock);
span.Inlines.Add(new InlineUIContainer()
{
Child = grid
});
}
开发者ID:sahirmemon,项目名称:SoftwareKobo.HtmlRender,代码行数:34,代码来源:GroupBoxContainer.cs
示例17: SimpleFlyout
public static void SimpleFlyout(object sender, string simpleMSG)
{
Flyout flyout = new Flyout();
Border border = new Border();
border.Width = 300;
border.Height = 125;
TextBlock tb = new TextBlock();
tb.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Center;
tb.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Center;
tb.TextWrapping = TextWrapping.Wrap;
tb.FontSize = 24.667;
tb.Text = simpleMSG;
tb.Foreground = new SolidColorBrush(Windows.UI.Colors.Black);
border.Child = tb;
flyout.Content = border;
flyout.Placement = (PlacementMode)Enum.Parse(typeof(PlacementMode), "Top");
flyout.PlacementTarget = sender as UIElement;
flyout.IsOpen = true;
ObjectTracker.Track(flyout);
}
开发者ID:huinalam,项目名称:WinRTRadioRss,代码行数:26,代码来源:FlyMenu.cs
示例18: OnApplyTemplate
/// <summary>
/// Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate.
/// In simplest terms, this means the method is called just before a UI element displays in your app.
/// Override this method to influence the default post-template logic of a class.
/// </summary>
protected override void OnApplyTemplate()
{
// Border
this.border = this.GetTemplateChild(BorderPartName) as Border;
if (this.border != null)
{
this.border.ManipulationStarted += Border_ManipulationStarted;
this.border.ManipulationDelta += Border_ManipulationDelta;
this.border.ManipulationCompleted += Border_ManipulationCompleted;
this.border.Tapped += Border_Tapped;
this.border.PointerEntered += Border_PointerEntered;
// Move Canvas properties from control to border.
Canvas.SetLeft(this.border, Canvas.GetLeft(this));
Canvas.SetLeft(this, 0);
Canvas.SetTop(this.border, Canvas.GetTop(this));
Canvas.SetTop(this, 0);
// Move Margin to border.
this.border.Padding = this.Margin;
this.Margin = new Thickness(0);
}
else
{
// Exception
throw new Exception("Floating Control Style has no Border.");
}
// Overlay
this.overlay = GetTemplateChild(OverlayPartName) as UIElement;
this.Loaded += Floating_Loaded;
}
开发者ID:XamlBrewer,项目名称:UWP-Floating-Content-Sample,代码行数:38,代码来源:FloatingContent.cs
示例19: OnApplyTemplate
protected override void OnApplyTemplate()
{
base.OnApplyTemplate();
_progressBorder = GetTemplateChild("ProgressBorder") as Border;
_border = GetTemplateChild("Border") as Border;
this.SizeChanged += ProgressButton_SizeChanged;
}
开发者ID:HppZ,项目名称:UniversalTest,代码行数:8,代码来源:ProgressButton.cs
示例20: AuthenticateAsync
public static Task<string> AuthenticateAsync(Uri uri)
{
var tcs = new TaskCompletionSource<string>();
var w = new WebView
{
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Stretch,
Margin = new Thickness(30.0),
};
var b = new Border
{
Background = new SolidColorBrush(Color.FromArgb(255, 255, 255, 255)),
Width = Window.Current.Bounds.Width,
Height = Window.Current.Bounds.Height,
Child = w
};
var p = new Popup
{
Width = Window.Current.Bounds.Width,
Height = Window.Current.Bounds.Height,
Child = b,
HorizontalOffset = 0.0,
VerticalOffset = 0.0
};
Window.Current.SizeChanged += (s, e) =>
{
p.Width = e.Size.Width;
p.Height = e.Size.Height;
b.Width = e.Size.Width;
b.Height = e.Size.Height;
};
w.Source = uri;
w.NavigationCompleted += (sender, args) =>
{
if (args.Uri != null)
{
if (args.Uri.OriginalString.Contains("access_token"))
{
tcs.SetResult(args.Uri.ToString());
p.IsOpen = false;
}
if (args.Uri.OriginalString.Contains("error=access_denied"))
{
tcs.SetResult(null);
p.IsOpen = false;
}
}
};
p.IsOpen = true;
return tcs.Task;
}
开发者ID:LocalJoost,项目名称:CustomFacebookoAuthLogin,代码行数:58,代码来源:FacebookAuthenticationBroker.cs
注:本文中的Windows.UI.Xaml.Controls.Border类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论