예제 #1
0
        public void ShowRandomApplicationTip()
        {
            var randomTip = HelpFeature.GetRandomFeature();

            int           rowCount = 0;
            StringBuilder sb       = new StringBuilder();

            sb.AppendLine("Did you know?");
            sb.AppendLine();

            foreach (var line in randomTip.HelpLines)
            {
                if (rowCount > 3)
                {
                    break;
                }

                sb.AppendLine(line.Content);
                rowCount++;
            }

            if (rowCount < randomTip.HelpLines.Count)
            {
                sb.AppendLine();
                sb.AppendLine("... (click to read more)");
            }

            _notificationManager.ShowAsync(
                content: new NotificationContent()
            {
                Title   = randomTip.Title,
                Message = sb.ToString(),
                Type    = NotificationType.Information
            },
                expirationTime: TimeSpan.FromSeconds(10),
                onClick: () =>
            {
                var quickTip = new QuickTipDialog(appSettingService, randomTip);

                quickTip.TrySetViewablePositionFromOwner(OwnerControl);
                quickTip.Show();
            });
        }
예제 #2
0
        private void GenerateRandomTip()
        {
            HelpFeature randomFeature = HelpFeature.GetRandomFeature();

            SetContents(randomFeature);
        }