Revision 97edb52f trunk/Pithos.Client.WPF/FileProperties/FilePropertiesViewModel.cs

b/trunk/Pithos.Client.WPF/FileProperties/FilePropertiesViewModel.cs
281 281
            {
282 282
                _permissionName = value;
283 283
                NotifyOfPropertyChange(()=>PermissionName);
284
                NotifyOfPropertyChange(() => CanAddPermission);
284 285
            }
285 286
        }
286 287

  
......
291 292
            set
292 293
            {
293 294
                _currentPermission = value;
295
                PermissionName = CurrentPermission.UserName;
296
                PermissionRead = CurrentPermission.Read;
297

  
294 298
                NotifyOfPropertyChange(()=>CurrentPermission);
299
                NotifyOfPropertyChange(() => PermissionName);
295 300
            }
296 301
        }
297 302

  
298 303

  
299
        private bool _permissionRead;
304
        private bool _permissionRead=true;
300 305
        public bool PermissionRead
301 306
        {
302 307
            get { return _permissionRead; }
......
304 309
            {
305 310
                _permissionRead = value;
306 311
                NotifyOfPropertyChange(()=>PermissionRead);
307
                if (CurrentPermission != null)
308
                {
309
                    CurrentPermission.Read = value;
310
                }
312
                NotifyOfPropertyChange(() => PermissionWrite);
311 313
            }
312 314
        }
315

  
313 316
        public bool PermissionWrite
314 317
        {
315
            get { return CurrentPermission.Write; }
318
            get
319
            {
320
                return !PermissionRead;
321
            }
316 322
            set
317 323
            {
318
                CurrentPermission.Write = value;
324
                _permissionRead = !value;
325
                NotifyOfPropertyChange(() => PermissionRead);
319 326
                NotifyOfPropertyChange(()=>PermissionWrite);
320 327
            }
321 328
        }
......
330 337
            Permissions.Add(new Permission{Read=PermissionRead,UserName=PermissionName,Write=!PermissionRead});   
331 338
        }
332 339

  
340
        public bool CanAddTag
341
        {
342
            get { return CurrentTag!=null && !String.IsNullOrWhiteSpace(CurrentTag.Name); }
343
        }
344

  
345
        public void AddTag()
346
        {
347
            Tags.Add(CurrentTag);   
348
        }
349

  
333 350

  
334 351
        public bool TagsChanged { get; private set; }
335 352
        public bool PermissionsChanged { get; private set; }
......
453 470
            }
454 471
        }
455 472

  
473
        private MetaValue _currentTag;
474
        public MetaValue CurrentTag
475
        {
476
            get { return _currentTag; }
477
            set
478
            {
479
                _currentTag = value;
480
                NotifyOfPropertyChange(()=>CurrentTag);
481
            }
482
        }
456 483

  
457 484
        private readonly ObservableCollection<MetaValue> _tags ;
458 485
        public ObservableCollection<MetaValue> Tags

Also available in: Unified diff