Example #1
0
        private async void AbbAddSyncPair_Click(object sender, RoutedEventArgs e)
        {
            SyncPair     newSync = new SyncPair();
            SyncPairEdit edit    = new SyncPairEdit(newSync, viewModel.Api);

            Frame.Navigate(typeof(SyncEditPage), edit);

            if (await edit.Task)
            {
                viewModel.Syncs.Add(newSync);
                App.SaveSyncPairs();
            }
        }
Example #2
0
        private async void MfiEdit_Click(object sender, RoutedEventArgs e)
        {
            SyncPair     oldSync = (SyncPair)((FrameworkElement)sender).DataContext;
            SyncPair     newSync = oldSync.Clone();
            SyncPairEdit edit    = new SyncPairEdit(newSync, viewModel.Api);

            Frame.Navigate(typeof(SyncEditPage), edit);

            int index;

            if (await edit.Task && viewModel.Syncs.TryIndexOf(s => s.Token == oldSync.Token, out index))
            {
                viewModel.Syncs[index] = newSync;
                App.SaveSyncPairs();
            }
        }
Example #3
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            edit = (SyncPairEdit)e.Parameter;

            PathPart[] serverPath = edit.Sync.ServerPath;
            if (serverPath != null)
            {
                for (int i = 0; i < serverPath.Length; i++)
                {
                    folderPaths[serverPath.Take(i + 1).GetNamePath().TrimEnd('\\')] = serverPath[i].Path;
                }
            }

            DataContext        = edit.Sync;
            asbServerPath.Text = edit.Sync.ServerPath.GetNamePath();

            base.OnNavigatedTo(e);
        }