Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Small Fixes

  • Loading branch information...
commit 9da1ee993f1c7e597cab6cde9a6cc3882449655d 1 parent 4b3e05a
@RobertKozak authored
View
6 Dialog/CellViews/Base/ListCellView.cs
@@ -49,6 +49,10 @@ public ListCellView(RectangleF frame) : base(frame)
{
}
+ public override void Initialize()
+ {
+ }
+
public override void UpdateCell(UITableViewCell cell, NSIndexPath indexPath)
{
var source = Controller.TableView.Source as BaseDialogViewSource;
@@ -63,7 +67,7 @@ public override void UpdateCell(UITableViewCell cell, NSIndexPath indexPath)
listSource.UpdateCell(cell, indexPath);
cell.TextLabel.Text = Caption;
-
+
if (listSource.IsMultiselect)
{
cell.Accessory = listSource.Sections[0].DataContext.Count > 0 ? UITableViewCellAccessory.DisclosureIndicator : UITableViewCellAccessory.None;
View
5 Dialog/DialogViewController/DataContextBinder.cs
@@ -94,6 +94,11 @@ public void HandleNotifyCollectionChanged(object sender, NotifyCollectionChanged
if (e.Action == NotifyCollectionChangedAction.Reset)
{
+ foreach(var item in Section.DataContext)
+ {
+ RemovePropertyChangedHandler(item);
+ }
+
Section.DataContext.Clear();
needsReload = true;
}
View
1  Dialog/DialogViewController/DialogViewController.cs
@@ -534,6 +534,7 @@ public override void ViewDidAppear(bool animated)
// var activation = RootView as IActivation;
// if (activation != null)
// activation.Activated();
+
}
}
View
4 Dialog/DialogViewController/ListSource.cs
@@ -354,11 +354,13 @@ public override void WillDisplay(UITableView tableView, UITableViewCell cell, NS
}
else
{
- if (sectionData.Count > 0)
+ if (sectionData.Count > 0 && sectionData[indexPath.Row] != null)
{
cell.TextLabel.AdjustsFontSizeToFitWidth = true;
cell.TextLabel.Text = sectionData[indexPath.Row].ToString();
}
+ else
+ Console.WriteLine("No Data: for row {0}, section {1}", indexPath.Row, indexPath.Section);
}
}
}
View
21 Dialog/DialogViewController/MemberData.cs
@@ -121,19 +121,16 @@ public void HandleNotifyPropertyChanged(object sender, PropertyChangedEventArgs
{
if (CanHandleNotifyPropertyChanged(e.PropertyName))
{
-// Log.Time("MemberData NotifyPropertyChanged property = "+ e.PropertyName+ " sender: "+sender.ToString(), ()=>
-// {
- var value = GetValue();
- if (_DataContextValue != null && _DataContextValue != value)
- {
- ResetCollection(_DataContextValue as INotifyCollectionChanged, value as IList);
- }
+ var value = GetValue();
+ if (_DataContextValue != null && _DataContextValue != value)
+ {
+ ResetCollection(_DataContextValue as INotifyCollectionChanged, value as IList);
+ }
- if (_Value != null && _Value != value)
- {
- ResetCollection(_Value as INotifyCollectionChanged, value as IList);
- }
-// });
+ if (_Value != null && _Value != value)
+ {
+ ResetCollection(_Value as INotifyCollectionChanged, value as IList);
+ }
}
}
View
8 Dialog/DialogViewController/ViewSource.cs
@@ -182,12 +182,6 @@ public override void UpdateCell(UITableViewCell cell, NSIndexPath indexPath)
if (dc.DataContext != memberData)
dc.DataContext = memberData;
}
-
-// var updateable = view as IUpdateable;
-// if (updateable != null)
-// {
-// updateable.UpdateCell(cell, indexPath);
-// }
var themeable = view as IThemeable;
if (themeable != null)
@@ -238,7 +232,7 @@ public override void WillDisplay(UITableView tableView, UITableViewCell cell, NS
}
}
}
-
+
public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
{
MemberData memberData = null;
View
16 Extensions/UIDeviceExtensions.cs
@@ -97,6 +97,22 @@ public static float GetActualWidth(this UIDevice device)
else
return UIScreen.MainScreen.Bounds.Width;
}
+
+ public static float GetActualHeight(this UIDevice device)
+ {
+ var orientation = device.Orientation;
+
+ var landscape = orientation == UIDeviceOrientation.LandscapeLeft || orientation == UIDeviceOrientation.LandscapeRight;
+
+ if (landscape)
+ {
+ return UIScreen.MainScreen.Bounds.Width;
+ }
+ else
+ {
+ return UIScreen.MainScreen.Bounds.Height;
+ }
+ }
}
}
View
21 Extensions/UIImageExtensions.cs
@@ -41,27 +41,6 @@ public static UIImage FromFile(this UIImage image, string filename, SizeF fitSiz
return imageFile.ImageToFitSize(fitSize);
}
-
- public static UIImage RemoveSharpEdges(this UIImage image, int radius)
- {
- var width = image.Size.Width;
- UIGraphics.BeginImageContextWithOptions(new SizeF(width, width), false, 0f);
- var context = UIGraphics.GetCurrentContext();
-
- context.BeginPath();
- context.MoveTo(width, width/2);
- context.AddArcToPoint(width, width, width / 2, width, radius);
- context.AddArcToPoint(0, width, 0, width / 2, radius);
- context.AddArcToPoint(0, 0, width / 2, 0, radius);
- context.AddArcToPoint(width, 0, width, width / 2, radius);
- context.ClosePath();
- context.Clip();
-
- image.Draw(new PointF(0, 0));
- var converted = UIGraphics.GetImageFromCurrentImageContext();
- UIGraphics.EndImageContext();
- return converted;
- }
public static UIImage ImageToFitSize(this UIImage image, float width, float height)
{
Please sign in to comment.
Something went wrong with that request. Please try again.