Ejemplo n.º 1
0
 public async void unloaded(object sender, RoutedEventArgs e)
 {
     LoadingProgressBar.IsIndeterminate = true;
     FilterIssuesFlyout.FilterArgs args = (sender as FilterIssuesFlyout).generateArgs();
     this.args = args;
     this.DefaultViewModel["FilterOn"] = !args.IsDefault();
     await client.updateRepoIssues(this.DefaultViewModel["repo"] as Repository, args.args);
     LoadingProgressBar.IsIndeterminate = false;
 }
Ejemplo n.º 2
0
        private async void AppButton_Click(object sender, RoutedEventArgs e)
        {
            AppBarButton b = sender as AppBarButton;
            if (b.Label == "Filter")
            {
                issuesList.SelectedIndex = -1;
                FilterIssuesFlyout flyout = new FilterIssuesFlyout(this.DefaultViewModel["repo"]);
                flyout.Unloaded += unloaded;
                flyout.ShowIndependent();
            }
            if (b.Label == "Clear Filter")
            {
                issuesList.SelectedIndex = -1;
                LoadingProgressBar.IsIndeterminate = true;
                this.DefaultViewModel["FilterOn"] = false;
                await client.updateRepoIssues(this.DefaultViewModel["repo"] as Repository, null);
                LoadingProgressBar.IsIndeterminate = false;
                args = null;
            }
            if (b.Label == "Home")
            {
                this.Frame.Navigate(typeof(HomePage));
            }
            if (b.Label == "Refresh")
            {
                int issue = issuesList.SelectedIndex;
                LoadingProgressBar.IsIndeterminate = true;
                await client.initializeRepo(this.DefaultViewModel["repo"] as Repository, (args == null) ? null : args.args);
                issuesList.SelectedIndex = issue;
                LoadingProgressBar.IsIndeterminate = false;
            }
            if (b.Label == "Pin")
            {
                if (issuesList.SelectedItem != null)
                {
                    client.PinIssue(issuesList.SelectedItem as Issue);
                    if(b.Flyout != null)
                        b.Flyout.ShowAt(b);
                }
            }
            if(b.Label == "Assign")
            {
                if (issuesList.SelectedItem != null && b.Flyout != null)
                {
                    b.Flyout.ShowAt(b);
                }
            }
            if(b.Label == "Add")
            {
                this.Frame.Navigate(typeof(AddEditIssuePage), null);
            }
            if(b.Label == "Edit")
            {
                if (issuesList.SelectedItem != null)
                {
                    this.Frame.Navigate(typeof(AddEditIssuePage), new KeyValuePair<object, object>(issuesList.SelectedItem, this.DefaultViewModel["repo"]));
                }
            }
            if(b.Label == "Redo")
            {

            }
        }