本文整理汇总了C#中MonoTouch.Dialog.DialogViewController类的典型用法代码示例。如果您正苦于以下问题:C# DialogViewController类的具体用法?C# DialogViewController怎么用?C# DialogViewController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DialogViewController类属于MonoTouch.Dialog命名空间,在下文中一共展示了DialogViewController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetViewController
public UIViewController GetViewController ()
{
var network = new BooleanElement ("Remote Server", EnableNetwork);
var host = new EntryElement ("Host Name", "name", HostName);
host.KeyboardType = UIKeyboardType.ASCIICapable;
var port = new EntryElement ("Port", "name", HostPort.ToString ());
port.KeyboardType = UIKeyboardType.NumberPad;
var root = new RootElement ("Options") {
new Section () { network, host, port }
};
var dv = new DialogViewController (root, true) { Autorotate = true };
dv.ViewDissapearing += delegate {
EnableNetwork = network.Value;
HostName = host.Value;
ushort p;
if (UInt16.TryParse (port.Value, out p))
HostPort = p;
else
HostPort = -1;
var defaults = NSUserDefaults.StandardUserDefaults;
defaults.SetBool (EnableNetwork, "network.enabled");
defaults.SetString (HostName ?? String.Empty, "network.host.name");
defaults.SetInt (HostPort, "network.host.port");
};
return dv;
}
示例2: Selected
public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath path)
{
Value = !Value;
var cell = tableView.CellAt (path);
ConfigCell (cell);
base.Selected (dvc, tableView, path);
}
示例3: TogglePicker
private void TogglePicker(DialogViewController dvc, UITableView tableView, NSIndexPath path)
{
var sectionAndIndex = GetMySectionAndIndex(dvc);
if(sectionAndIndex.Key != null)
{
Section section = sectionAndIndex.Key;
int index = sectionAndIndex.Value;
var cell = tableView.CellAt(path);
if(isPickerPresent)
{
// Remove the picker.
cell.DetailTextLabel.TextColor = UIColor.Gray;
section.Remove(datePickerContainer);
isPickerPresent = false;
}
else
{
// Show the picker.
cell.DetailTextLabel.TextColor = UIColor.Red;
datePickerContainer = new UIViewElement(string.Empty, datePicker, false);
section.Insert(index + 1, UITableViewRowAnimation.Bottom, datePickerContainer);
isPickerPresent = true;
}
}
}
示例4: LoginPageRenderer
public LoginPageRenderer()
{
dialog = new DialogViewController(new RootElement("Login"));
window = new UIWindow(UIScreen.MainScreen.Bounds);
window.RootViewController = new UINavigationController(dialog);
window.MakeKeyAndVisible();
if (App.IsGoogleLogin && !App.IsLoggedIn)
{
var myAuth = new GoogleAuthenticator("730990345527-h7r23gcdmdllgke4iud4di76b0bmpnbb.apps.googleusercontent.com",
"https://www.googleapis.com/auth/userinfo.email",
"https://accounts.google.com/o/oauth2/auth",
"https://www.googleapis.com/plus/v1/people/me");
UIViewController vc = myAuth.authenticator.GetUI();
myAuth.authenticator.Completed += async (object sender, AuthenticatorCompletedEventArgs eve) =>
{
//dialog.DismissViewController(true, null);
window.Hidden = true;
dialog.Dispose();
window.Dispose();
if (eve.IsAuthenticated)
{
var user = await myAuth.GetProfileInfoFromGoogle(eve.Account.Properties["access_token"].ToString());
await App.SaveUserData(user,true);
//dialog.DismissViewController(true, null);
App.IsLoggedIn = true;
App.SuccessfulLoginAction.Invoke();
}
};
dialog.PresentViewController(vc, true, null);
}
}
示例5: FinishedLaunching
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
// create a new window instance based on the screen size
window = new UIWindow (UIScreen.MainScreen.Bounds);
var web = new WebElement ();
web.HtmlFile = "instructions";
var root = new RootElement ("Kannada Keyboard") {
new Section{
new UIViewElement("Instruction", web.View, false)
}
};
var dv = new DialogViewController (root) {
Autorotate = true
};
var navigation = new UINavigationController ();
navigation.PushViewController (dv, true);
window = new UIWindow (UIScreen.MainScreen.Bounds);
window.MakeKeyAndVisible ();
window.AddSubview (navigation.View);
return true;
}
示例6: FinishedLaunching
// This method is invoked when the application has loaded its UI and its ready to run
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
var Last = new DateTime (2010, 10, 7);
Console.WriteLine (Last);
window.AddSubview (navigation.View);
var menu = new RootElement ("Demos"){
new Section ("Element API"){
new StringElement ("iPhone Settings Sample", DemoElementApi),
new StringElement ("Dynamically load data", DemoDynamic),
new StringElement ("Add/Remove demo", DemoAddRemove),
new StringElement ("Assorted cells", DemoDate),
},
new Section ("Auto-mapped", footer){
new StringElement ("Reflection API", DemoReflectionApi)
},
new Section ("Other"){
new StringElement ("Headers and Footers", DemoHeadersFooters)
}
};
var dv = new DialogViewController (menu);
navigation.PushViewController (dv, true);
window.MakeKeyAndVisible ();
return true;
}
示例7: FlyoutNavigationController
public FlyoutNavigationController(UITableViewStyle navigationStyle = UITableViewStyle.Plain)
{
navigation = new DialogViewController(navigationStyle,null);
navigation.OnSelection += NavigationItemSelected;
var navFrame = navigation.View.Frame;
navFrame.Width = menuWidth;
navigation.View.Frame = navFrame;
this.View.AddSubview (navigation.View);
SearchBar = new UISearchBar (new RectangleF (0, 0, navigation.TableView.Bounds.Width, 44)) {
//Delegate = new SearchDelegate (this),
TintColor = this.TintColor
};
TintColor = UIColor.Black;
//navigation.TableView.TableHeaderView = SearchBar;
navigation.TableView.TableFooterView = new UIView (new RectangleF (0, 0, 100, 100)){BackgroundColor = UIColor.Clear};
navigation.TableView.ScrollsToTop = false;
shadowView = new UIView ();
shadowView.BackgroundColor = UIColor.White;
shadowView.Layer.ShadowOffset = new System.Drawing.SizeF (-5, -1);
shadowView.Layer.ShadowColor = UIColor.Black.CGColor;
shadowView.Layer.ShadowOpacity = .75f;
closeButton = new UIButton ();
closeButton.TouchDown += delegate {
HideMenu ();
};
AlwaysShowLandscapeMenu = true;
this.View.AddGestureRecognizer (new OpenMenuGestureRecognizer (this, new Selector ("panned"), this));
ShouldAutoPushFirstView = true;
}
示例8: RepMaxView
public RepMaxView(Exercise exerciseToShow)
: base("RepMaxView", null)
{
this._exercise = exerciseToShow;
this._share = new RMShare(this);
largestRMValue = 0.0;
string dbname = "onerm.db";
string documents = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // This goes to the documents directory for your app
string dbPath = Path.Combine (documents, dbname);
db = new SQLiteConnection (dbPath);
this.LoadRecords();
this._logRoot = new RootElement ("Records");
this._dvc = new DialogViewController (UITableViewStyle.Plain, this._logRoot, false);
// load data from list
this._logSect = new Section ();
foreach (RmLog rm in this._rms) {
StringElement recordString = new StringElement (rm.Weight.ToString(), rm.DateLogged.ToShortDateString());
this._logSect.Add(recordString);
}
this._logRoot.Add(this._logSect);
}
示例9: FinishedLaunching
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
root = new RootElement ("To Do List"){new Section()};
rootVC = new DialogViewController (root);
nav = new UINavigationController(rootVC);
btnAdd = new UIBarButtonItem (UIBarButtonSystemItem.Add);
rootVC.NavigationItem.RightBarButtonItem = btnAdd;
btnAdd.Clicked += (sender, e) => {
++n;
var task = new Task{Name = "task" + n, DueDate = DateTime.Now};
var taskElement = new RootElement(task.Name){
new Section (){
new EntryElement (task.Name, "Enter task description", task.Description)
},
new Section(){
new DateElement("Due Date", task.DueDate)
}
};
root[0].Add (taskElement);
};
viewController = new to_do_listViewController ();
window.RootViewController = nav;
window.MakeKeyAndVisible ();
return true;
}
示例10: Selected
public override void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path)
{
base.Selected(dvc, tableView, path);
if (Tapped != null)
Tapped();
tableView.DeselectRow (path, true);
}
示例11: FinishedLaunching
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
exampleInfoList = ExampleLibrary.Examples.GetList();
// create a new window instance based on the screen size
window = new UIWindow (UIScreen.MainScreen.Bounds);
navigation = new UINavigationController();
var root = new RootElement ("OxyPlot Example Browser");
var section = new Section ();
section.AddAll (exampleInfoList
.GroupBy (e => e.Category)
.OrderBy (g => g.Key)
.Select (g =>
(Element)new StyledStringElement (g.Key, delegate {
DisplayCategory (g.Key);
}) { Accessory = UITableViewCellAccessory.DisclosureIndicator }));
root.Add (section);
var dvc = new DialogViewController (root, true);
navigation.PushViewController(dvc, true);
window.RootViewController = navigation;
// make the window visible
window.MakeKeyAndVisible ();
return true;
}
示例12: DemoElementApi
public void DemoElementApi ()
{
var root = CreateRoot ();
var dv = new DialogViewController (root, true);
navigation.PushViewController (dv, true);
}
示例13: PopoverContentViewController
public PopoverContentViewController(SizeF contentSizeForViewInPopover)
{
_contentSizeForViewInPopover = contentSizeForViewInPopover;
QuickFillCore quickFillCore = QuickFillManager.GetQuickFillCore ();
var quickFillNames = quickFillCore.QuickFillNames;
var styleHeaderElement = new Section ("Style Header") {
new RootElement ("Manual Entry", rt => GetNewDialog(StyleEntityManager.GetManualEntry()))
};
var quickFillElement = new Section ("Quick Fill");
var quickFills = StyleEntityManager.GetQuickFills (quickFillCore);
var styleDialogs = new List<RootElement> ();
for (int i = 0; i < quickFillNames.Count; i++)
{
var style = GetNewDialog (quickFills [i]);
var rootElement = new RootElement (quickFillNames [i], rt => style);
styleDialogs.Add (rootElement);
}
quickFillElement.AddAll (styleDialogs);
var rootStyles = new RootElement ("Add New Styles");
rootStyles.Add (new [] { styleHeaderElement, quickFillElement });
var rootDialog = new DialogViewController (rootStyles);
rootDialog.NavigationItem.SetLeftBarButtonItem (new UIBarButtonItem ("Cancel", UIBarButtonItemStyle.Bordered, HandlePopoverCancelledEvent), true);
this.SetViewControllers (new [] { rootDialog }, true);
}
示例14: GetCell
public override MonoTouch.UIKit.UITableViewCell GetCell(DialogViewController dvc, MonoTouch.UIKit.UITableView tv)
{
var cell = base.GetCell (dvc, tv);
cell.ImageView.Image = ImageStore.GetLocalProfilePicture(Friend.ID);
cell.DetailTextLabel.Text = "Shot Count: " + Friend.HitCount;
return cell;
}
示例15: FinishedLaunching
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
exampleInfoList = ExampleLibrary.Examples.GetList();
// create a new window instance based on the screen size
window = new UIWindow (UIScreen.MainScreen.Bounds);
navigation = new UINavigationController();
var root = new RootElement ("OxyPlot Demo") {
new Section() {
from e in exampleInfoList
group e by e.Category into g
orderby g.Key
select (Element)new StyledStringElement (g.Key, delegate {
DisplayCategory(g.Key);
}) { Accessory = UITableViewCellAccessory.DisclosureIndicator }
}
};
var dvc = new DialogViewController (root, true);
navigation.PushViewController(dvc, true);
window.RootViewController = navigation;
// make the window visible
window.MakeKeyAndVisible ();
return true;
}