private void UpdateVersions() { TextBlock.Blocks.Clear(); if (ConflictVersionInfo == null) { return; } var para = new Paragraph(); var navigateCommand = new NavigateToCommand(); var count = 1; foreach (var version in ConflictVersionInfo) { var versionId = version.Value <string>("Id"); var sourceId = version.Value <string>("SourceId"); ReplicationSourceInfo sourceInfo = null; if (ReplicationSourcesLookup != null) { ReplicationSourcesLookup.TryGetValue(sourceId, out sourceInfo); } var hyperlink = new InlineUIContainer() { Child = new HyperlinkButton() { Content = count.ToString() + (sourceInfo != null ? " (" + sourceInfo.Name + ")" : ""), Command = navigateCommand, CommandParameter = "/edit?id=" + versionId } }; if (sourceInfo != null) { var toolTip = CreateToolTip(versionId, sourceInfo); ToolTipService.SetToolTip(hyperlink.Child, toolTip); } para.Inlines.Add(hyperlink); para.Inlines.Add(" "); count++; } TextBlock.Blocks.Add(para); }
private object CreateToolTip(string versionId, ReplicationSourceInfo sourceInfo) { var textBlock = new TextBlock() { Inlines = { new Bold() { Inlines ={ new Run { Text = "Document Id:" } } }, new Run() { Text = " " }, new Run { Text = versionId }, new LineBreak(), new Bold() { Inlines ={ new Run { Text = "Server Url:" } } }, new Run() { Text = " " }, new Run { Text = sourceInfo.Url }, } }; return(textBlock); }
private object CreateToolTip(string versionId, ReplicationSourceInfo sourceInfo) { var textBlock = new TextBlock() { Inlines = { new Bold() {Inlines = {new Run {Text = "Document Id:"}}}, new Run() {Text = " "}, new Run {Text = versionId}, new LineBreak(), new Bold() {Inlines = {new Run {Text = "Server Url:"}}}, new Run() {Text = " "}, new Run {Text = sourceInfo.Url}, } }; return textBlock; }