本文整理汇总了C#中System.Windows.Controls.HyperlinkButton类的典型用法代码示例。如果您正苦于以下问题:C# HyperlinkButton类的具体用法?C# HyperlinkButton怎么用?C# HyperlinkButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HyperlinkButton类属于System.Windows.Controls命名空间,在下文中一共展示了HyperlinkButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HyperlinkButtonAutomationPeer
public HyperlinkButtonAutomationPeer (HyperlinkButton owner)
: base (owner)
{
owner.Click += (s, a) => {
RaiseAutomationEvent (AutomationEvents.InvokePatternOnInvoked);
};
}
示例2: OnNavigatedTo
// 当用户导航到此页面时执行。
protected override void OnNavigatedTo(NavigationEventArgs e)
{
//Add MainPage
{
HyperlinkButton lHyperLinkButton = new HyperlinkButton();
lHyperLinkButton.Content = "重要部件到货信息";
lHyperLinkButton.NavigateUri = new System.Uri("ProductManagerMain", UriKind.Relative);
lHyperLinkButton.Style = Application.Current.Resources["LinkStyleMenu"] as Style;
lHyperLinkButton.TargetName = "ProductManagerContentFrame";
ProductManagerMenu.Children.Add(lHyperLinkButton);
lHyperLinkButton.Click += HyperLinkButton_Click;
}
ProductManagerViewModel productManagerViewModel = this.DataContext as ProductManagerViewModel;
foreach (ISubMenu lSubMenu in productManagerViewModel.SubMenuList)
{
HyperlinkButton lHyperLinkButton = new HyperlinkButton();
lHyperLinkButton.Content = lSubMenu.Content;
lHyperLinkButton.NavigateUri = new System.Uri(lSubMenu.NavigateUri, UriKind.Relative);
lHyperLinkButton.Style = Application.Current.Resources["LinkStyleMenu"] as Style;
lHyperLinkButton.TargetName = "ProductManagerContentFrame";
ProductManagerMenu.Children.Add(lHyperLinkButton);
lHyperLinkButton.Click += HyperLinkButton_Click;
}
}
示例3: UpdateCurrentPageIndicatorPosition
private void UpdateCurrentPageIndicatorPosition(HyperlinkButton button)
{
GeneralTransform gt = button.TransformToVisual(MenuContainer);
Point offset = gt.Transform(new Point(0, 0));
CurrentPageIndicator.Margin = new Thickness(offset.X + button.ActualWidth / 2 - 7.5, 0, 0, 0);
}
示例4: PopupMessageWithAction
public PopupMessageWithAction(PopupMessageType messageType, string message, string leftButtonText, string rightButtonText, Action leftButtonAction, Action rightButtonAction, Action noButtonAction, HyperlinkButton hyperLink)
: base(messageType, message, leftButtonText, rightButtonText, hyperLink)
{
this.LeftButtonAction = leftButtonAction;
this.RightButtonAction = rightButtonAction;
this.NoButtonAction = noButtonAction;
}
示例5: AssociationsContainerView
public AssociationsContainerView(AssociationUser associationUser)
{
InitializeComponent();
Manager = associationUser;
this.Loaded += new RoutedEventHandler(AssociationsContainerView_Loaded);
CloseButton = new HyperlinkButton();
CloseButton.Content = "Close X";
CloseButton.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
CloseButton.VerticalAlignment = System.Windows.VerticalAlignment.Top;
CloseButton.Margin = new Thickness(0, 20, 20, 0);
if (AssociationProfileContainer.Children.Count == 0)
{
view = KernelContainer.Kernel.Get<AssociationsView>();
viewModel = KernelContainer.Kernel.Get<AssociationsViewModel>();
viewModel.AssociationManagerId = Manager.Id;
AssociationsViewModel.IsStaffApp = true;
view.DataContext = viewModel;
(view.FindName("LayoutRoot") as Grid).Children.Add(CloseButton);
AssociationProfileContainer.Children.Add(view);
}
}
示例6: AddExample
private void AddExample(StackPanel owner, string title, string src)
{
var bt = new HyperlinkButton();
bt.Content = title;
bt.Click += GetHandlerForExample(src);
owner.Children.Add(bt);
}
示例7: HyperlinkMatchesUri
private static bool HyperlinkMatchesUri(string uri, HyperlinkButton link)
{
var queryStart = uri.IndexOf('/', Math.Min(uri.Length, 1));
if (queryStart < 0)
{
queryStart = uri.IndexOf('?');
}
if (queryStart > 0)
{
uri = uri.Substring(0, queryStart);
}
if (link.CommandParameter != null &&
uri.Equals(link.CommandParameter.ToString(), StringComparison.InvariantCultureIgnoreCase))
{
return true;
}
var alternativeUris = LinkHighlighter.GetAlternativeUris(link);
if (alternativeUris != null && alternativeUris.Any(alternative => uri.Equals(alternative, StringComparison.InvariantCultureIgnoreCase)))
{
return true;
}
return false;
}
示例8: CreateBaseLink
Inline CreateBaseLink(string content, string contextHeader, string contextTag, MenuItem customButton = null)
{
var link = new HyperlinkButton
{
Content = content,
FontSize = Text.FontSize,
FontWeight = Text.FontWeight,
FontStretch = Text.FontStretch,
FontFamily = Text.FontFamily,
TargetName = contextTag,
Margin = new Thickness(-10, -5, -10, -8)
};
link.Click += new RoutedEventHandler(link_Click);
MenuItem item = new MenuItem
{
Header = contextHeader,
Tag = contextTag,
Foreground = new SolidColorBrush(Colors.Black)
};
item.Click += new RoutedEventHandler(CopyLink);
ContextMenu menu = new ContextMenu();
menu.Items.Add(item);
if (customButton != null)
menu.Items.Add(customButton);
ContextMenuService.SetContextMenu(link, menu);
InlineUIContainer container = new InlineUIContainer();
container.Child = link;
return container;
}
示例9: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/EcosCab;component/Controls/ucDeviceInfo.xaml", System.UriKind.Relative));
this.linkDeviceService = ((System.Windows.Controls.HyperlinkButton)(this.FindName("linkDeviceService")));
}
示例10: AdvancedMessageBox_Click
private void AdvancedMessageBox_Click(object sender, RoutedEventArgs e)
{
HyperlinkButton hyperlinkButton = new HyperlinkButton()
{
Content = "Más información.",
HorizontalAlignment = HorizontalAlignment.Left,
NavigateUri = new Uri("http://javiersuarezruiz.wordpress.com/", UriKind.Absolute)
};
TiltEffect.SetIsTiltEnabled(hyperlinkButton, true);
ListPicker listPicker = new ListPicker()
{
Header = "Recordar en:",
ItemsSource = new string[] { "5 minutos", "10 minutos", "15 minutos" }
};
StackPanel stackPanel = new StackPanel();
stackPanel.Children.Add(hyperlinkButton);
stackPanel.Children.Add(listPicker);
CustomMessageBox messageBox = new CustomMessageBox()
{
Title = "Recordatorio",
Caption = "Programar Windows Phone",
Message = "Realizar ejemplo del control CustomMessageBox",
Content = stackPanel,
LeftButtonContent = "Aceptar",
RightButtonContent = "Cancelar",
IsFullScreen = (bool)FullScreenCheckBox.IsChecked
};
messageBox.Dismissing += (s1, e1) =>
{
if (listPicker.ListPickerMode == ListPickerMode.Expanded)
{
e1.Cancel = true;
}
};
messageBox.Dismissed += (s2, e2) =>
{
switch (e2.Result)
{
case CustomMessageBoxResult.LeftButton:
// Acción.
break;
case CustomMessageBoxResult.RightButton:
case CustomMessageBoxResult.None:
// Acción.
break;
default:
break;
}
};
messageBox.Show();
}
示例11: 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;
}
示例12: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/DataVisualizationOnWindowsPhone;component/MainPage1.xaml", System.UriKind.Relative));
this.myChart = ((System.Windows.Controls.DataVisualization.Charting.Chart)(this.FindName("myChart")));
this.hyperlinkButton1 = ((System.Windows.Controls.HyperlinkButton)(this.FindName("hyperlinkButton1")));
}
示例13: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/SpikeSilverlightApplication;component/MainPage.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.chButton = ((System.Windows.Controls.Button)(this.FindName("chButton")));
this.tabBTn = ((System.Windows.Controls.HyperlinkButton)(this.FindName("tabBTn")));
}
示例14: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/test;component/SecongPage.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.ContentPanel = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
this.Hyperlink = ((System.Windows.Controls.HyperlinkButton)(this.FindName("Hyperlink")));
}
示例15: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/MetalXmas2010;component/FeedbackDialog.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.OKButton = ((System.Windows.Controls.Button)(this.FindName("OKButton")));
this.CancelButton = ((System.Windows.Controls.HyperlinkButton)(this.FindName("CancelButton")));
}