本文整理汇总了C#中System.Windows.Controls.HyperlinkButton.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# HyperlinkButton.SetValue方法的具体用法?C# HyperlinkButton.SetValue怎么用?C# HyperlinkButton.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.HyperlinkButton
的用法示例。
在下文中一共展示了HyperlinkButton.SetValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlaceHyperlinkPrimitive
public static HyperlinkButton PlaceHyperlinkPrimitive(Grid Container, int Col, int Row)
{
HyperlinkButton hyperlink = new HyperlinkButton();
hyperlink.SetValue(Grid.ColumnProperty, Col);
hyperlink.SetValue(Grid.RowProperty, Row);
hyperlink.Style = (Style)Application.Current.Resources["CellHyperLink"];
Container.Children.Add(hyperlink);
return hyperlink;
}
示例2: RenderPost
protected void RenderPost(MitbbsPostBase post)
{
// Header
//
Border headerLine = new Border();
headerLine.BorderThickness = new Thickness(1);
headerLine.Margin = new Thickness(0, 10, 0, 0);
//headerLine.BorderBrush = (Brush)App.Current.Resources["PhoneAccentBrush"];
headerLine.BorderBrush = new LinearGradientBrush()
{
StartPoint = new Point(0, 0),
EndPoint = new Point(1, 0),
GradientStops = new GradientStopCollection()
{
new GradientStop()
{
Color = ((SolidColorBrush)App.Current.Resources["PhoneAccentBrush"]).Color,
Offset = 0
},
new GradientStop()
{
Color = ((SolidColorBrush)App.Current.Resources["PhoneSubtleBrush"]).Color,
Offset = 0.8
},
new GradientStop()
{
Color = ((SolidColorBrush)App.Current.Resources["PhoneBackgroundBrush"]).Color,
Offset = 1
},
}
};
//headerLine.BorderBrush = (Brush)App.Current.Resources["PhoneSubtleBrush"];
//headerLine.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 112, 146, 190));
headerLine.Height = .5;
_firstPostControls.Add(headerLine);
_topicBodyPanel.Children.Add(headerLine);
StackPanel headerPanel = new StackPanel();
headerPanel.Orientation = System.Windows.Controls.Orientation.Vertical;
Grid headerPanel2 = new Grid();
ColumnDefinition column1 = new ColumnDefinition();
column1.Width = new GridLength(1, GridUnitType.Star);
ColumnDefinition column2 = new ColumnDefinition();
column2.Width = new GridLength(1, GridUnitType.Auto);
headerPanel2.ColumnDefinitions.Add(column1);
headerPanel2.ColumnDefinitions.Add(column2);
Grid expandButtonPanel = new Grid();
expandButtonPanel.VerticalAlignment = System.Windows.VerticalAlignment.Bottom;
StackPanel headerPanel3 = new StackPanel();
headerPanel3.Orientation = System.Windows.Controls.Orientation.Vertical;
headerPanel3.VerticalAlignment = System.Windows.VerticalAlignment.Bottom;
Button expandButton = new Button();
ImageBrush expandButtonImage = new ImageBrush();
expandButtonImage.ImageSource = new BitmapImage(new Uri("/MitbbsReader;component/Images/overflowdots.png", UriKind.Relative));
expandButtonImage.Stretch = Stretch.None;
expandButton.Style = (Style)Application.Current.Resources["ImageButton"];
expandButton.Content = expandButtonImage;
expandButton.Padding = new Thickness(0);
expandButton.BorderThickness = new Thickness(0);
expandButton.Margin = new Thickness(0);
expandButton.Width = 93;
expandButton.Height = 54;
GestureListener gl = GestureService.GetGestureListener(expandButton);
gl.Tap += new EventHandler<Microsoft.Phone.Controls.GestureEventArgs>(GeneralButton_Tapped);
expandButton.Click += ExpandButton_Click;
headerPanel3.SetValue(Grid.ColumnProperty, 0);
expandButtonPanel.SetValue(Grid.ColumnProperty, 1);
headerPanel2.Children.Add(headerPanel3);
headerPanel2.Children.Add(expandButtonPanel);
expandButtonPanel.Children.Add(expandButton);
headerPanel.Children.Add(headerPanel2);
TextBlock authorText = new TextBlock();
authorText.Text = "作者: " + post.Author;
authorText.FontWeight = FontWeights.ExtraBold;
//authorText.Style = (Style)App.Current.Resources["PhoneTextAccentStyle"];
authorText.FontSize = (double)App.Current.Resources["MitbbsFontSizeNormal"];
authorText.Margin = new Thickness(0);
authorText.TextWrapping = TextWrapping.Wrap;
TextBlock sourceText = new TextBlock();
sourceText.Text = "时间: " + post.IssueDate;
sourceText.FontWeight = FontWeights.ExtraBold;
//sourceText.Style = (Style)App.Current.Resources["PhoneTextAccentStyle"];
sourceText.FontSize = (double)App.Current.Resources["MitbbsFontSizeNormal"];
sourceText.Margin = new Thickness(0);
sourceText.TextWrapping = TextWrapping.Wrap;
headerPanel3.Children.Add(authorText);
//.........这里部分代码省略.........
示例3: addparamUI
private void addparamUI( string labelText, string value, bool url)
{
#region
ParamContainer.RowDefinitions.Add(new RowDefinition());
TextBlock label = new TextBlock() { Text = labelText, VerticalAlignment = System.Windows.VerticalAlignment.Center, Padding= new Thickness(2,0,2,0) };
label.SetValue(Grid.RowProperty, ParamContainer.RowDefinitions.Count - 1);
label.MaxWidth = 200;
label.TextTrimming = TextTrimming.WordEllipsis;
ToolTipService.SetToolTip(label, labelText);
ParamContainer.Children.Add(label);
TextBlock tb = new TextBlock() { Text = value, Padding = new Thickness(2, 0, 2, 0) };
tb.MaxWidth = 240;
tb.TextTrimming = TextTrimming.WordEllipsis;
ToolTipService.SetToolTip(tb, value);
if (url && !string.IsNullOrWhiteSpace(value))
{
System.Windows.Controls.HyperlinkButton hl = new System.Windows.Controls.HyperlinkButton() { NavigateUri = new Uri(value), Content = tb, TargetName = "_blank", Padding = new Thickness(2, 0, 2, 0) };
hl.SetValue(Grid.RowProperty, ParamContainer.RowDefinitions.Count - 1);
hl.SetValue(Grid.ColumnProperty, 1);
ParamContainer.Children.Add(hl);
}
else
{
tb.SetValue(Grid.RowProperty, ParamContainer.RowDefinitions.Count - 1);
tb.SetValue(Grid.ColumnProperty, 1);
ParamContainer.Children.Add(tb);
}
#endregion
HasSimpleResults = true;
}
示例4: ShowViewer
public void ShowViewer()
{
ImagePanel.Children.Clear();
HyperlinkButton viewerLink = new HyperlinkButton();
viewerLink.SetValue(TiltEffect.IsTiltEnabledProperty, true);
viewerLink.Content = ErrorText;
viewerLink.Click += ImageViewerLink_Click;
viewerLink.TargetName = "_new";
viewerLink.DataContext = ImageUrl;
viewerLink.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
viewerLink.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Left;
GestureListener gl = GestureService.GetGestureListener(viewerLink);
gl.Tap += new EventHandler<Microsoft.Phone.Controls.GestureEventArgs>(GeneralButton_Tapped);
if (FontColor != null)
{
viewerLink.Foreground = FontColor;
}
if (FontSize > 0)
{
viewerLink.FontSize = FontSize;
}
ImagePanel.Children.Add(viewerLink);
}