Example #1
0
        private void _element_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            var sv = VisualTreeHelpers.FindParent <ScrollViewer>(_element);

            if (sv != null)
            {
                if (DisableHorizontal)
                {
                    sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
                }
                if (DisableVertical)
                {
                    sv.VerticalScrollBarVisibility = ScrollBarVisibility.Disabled;
                }
            }
        }
Example #2
0
        private void Listbox_Accounts_MouseDoubleClick(object sender, RoutedEventArgs e)
        {
            if (steam.IsRunning())
            {
                steam.Kill();
                Thread.Sleep(200);
            }

            var listBoxItem = VisualTreeHelpers.FindParent <ListBoxItem>((DependencyObject)e.OriginalSource);

            if (listBoxItem == null)
            {
                throw new InvalidOperationException("ListBoxItem not found");
            }

            var    account           = App.Controller.Accounts.First(ac => ac.Username.Equals(((SteamAccount)listBoxItem.Content).Username));
            string decryptedPassword = Crypto.DecryptString(account.EncryptedPassword, account.Iv);

            steam.Run(account.Username, decryptedPassword);
        }