Xamarin Forms - does PopAsync release the popped page? - xamarin.forms

I have a Xamarin Forms app that pushes (and then pops) a new version of the same page class multiple times. Will this create multiple copies of the page in memory, or is each one released/destroyed when it is popped?

Per the implementation, PopAsync should discard the page.
But I believe you may be suffering from the following bug: https://github.com/xamarin/Xamarin.Forms/issues/1429
This, of course, assumes you are using the "vanilla" Xamarin.Forms.

Related

Sync fusion Xamarin forms standard entry/editor

I’m enjoying the control suite from sync fusion for their auto complete and numeric editor. Just wanting a standard text entry and a multi line entry but there doesn’t seem to be any in their controls, unless I’m missing something?
The main problem is when I go and use the base entry and editor controls with Xamarin forms they totally look and behave differently and make it look quite jarring in the app so want to find these standard controls to keep it the same through out the app.
Anyone got any ideas?

Xamarin Templates -IOS

I am currently learning app-building basics with Xamarin. My question is what is the difference between "Blank-App (iPhone)" and "Master-Detail App (iPhone)".
Thanks for taking the time to answer my question.
These are two different templates for you to choose.
Blank-App (iPhone) means you just create an empty project without storyboard, RootViewController or other extensions. You can customize it whatever you want. If you are new to Xamarin.iOS and unsure about what template to use, try to use Single View Application.
Master-Detail App (iPhone) means when you choose this template. System will automatically create a UISplitViewController with a default Detail and Master for you. So there's no need to configure the rootView. It's a type of showing the ViewController.
You can try to create these two template projects then run to see the difference between them.

ASP.NET MVC State Management

I am working on a .net mvc web application that has a bunch of web parts on the homepage. I realize that a webpart is a .net forms terminology, but wasn't sure what to name those mini sections. So anyways, for now these sections are called when that page is rendered, but eventually I will plug in JQuery and call these sections using AJAX. These mini sections or widgets will need to keep state as the user navigates between the homepage and back. With .net forms, the page state info is kept in the viewstate, but with .net mvc, that is not available (thankfully).
So, is there a framework already created for such functionality for MVC? If not, what would be the best way to handle this situation? I was thinking to leverage the HttpContext object and store everything in there, but not sure if that object has any size limitations.
Just like with anything else in MVC you're going to need to store the state somewhere. As other users have pointed out, using Partial Views will reduce the complication of the design by allowing you to have controllers that handle just those small parts. They can then be responsible for saving/restoring/tracking the state or info for that part. (This could be using a database, in process memory, whatever.)
If you put the controls in the master page you can have the parts' implementation removed from your other logic so you don't need to worry about capturing and returning data related to those parts with the rest of your model meant for your view.
Having the parts separate like that will make it a lot easier to AJAXify them as well since they would already be operating independently of your view data even though they are rendered at the same time.
I think you want to check out Partial Views.
You can use output caching or data caching, both supported by MVC 1.0/2.0.
Not sure if you're after this but project Orchard has a notion of widgets: http://www.orchardproject.net/docs/Default.aspx?Page=widgets&NS=&AspxAutoDetectCookieSupport=1.

Showing a form from a webpage

I have a problem I am trying to solve in an elegant manner. I have a .net application that I have created. I am trying to get one of the forms to be shown from a webpage. This sounds strange I'll admit, so here is the backstory
We have some large monitors at work, that show information on them. I have no control over how the information is displayed. Currently they are just using a browser and tabbing in the browser to show each different piece of information on the screen. Most of the info they show is just standard html stuff, text and images.
Now along comes my winforms application. The part of the application I need to show is a graphical display. Everything on this display is drawn using GDI+, if that matters. I need to get this form into a format that I can show. Below is my own solution, but I am pretty sure this is not the best method, but it may be the only method I can use
Create a console application. The application would do the following
1. Run as a service on a server
2. Create the display in memory, and save it to a bitmap every so ofter
3. Save the bitmap to a location on the network.
4. have an HTML file that links the image that can be shown in the browser
I though about doing something with the clients, however the clients are not always up, so I could have periods where the image wouldnt be updated.
I also was thinking about an ASP.net solution, but that would require me to learn ASP.net, and I am not quite ready to take that challenge
In IE you can host a winforms app/control as an ActiveX control, like so:
<object id="DateTimePicker" height="31" width="177"
classid="bin/Web.Controls.DateTime.dll#Web.Controls.DateTime.DateTimePicker" VIEWASTEXT>
</object>
See this article for more information: http://www.codeproject.com/KB/miscctrl/htmlwincontrol.aspx
Now, I'm not claiming that this is any more elegant than your solution, but it is an alternative.
I think using Asp.Net to serve a dynamic image using a HttpHandler would be the best approach, but depending on your skills and time this may not be an option. Here is a nice tutorial: http://www.codeguru.com/columns/dotnet/article.php/c11013
IMHO The best way to build this would be as a browser plug-in, like how Flash works. Microsoft has created a plug-in framework called SpicIE, that allows you develop managed plug-ins for IE. This is probably your best bet.
The old unmanaged way is to build out your WinForms dll app and then package it in a signed cab file, and then reference that cab file with an HTML object tag (codebase arg is the one you need).
i.e.,
document.write("<object CLASSID='clsid:DC187740-46A9-11D5-A815-00B0D0428C0C' CODEBASE='/MyFormsApp/MyFormsApp.cab#Version=1,00,0000' />");
The first time the user hits the page they will be asked to allow for the installer to load its payload (dll's). Once they do, they will have a fully fledged WinForms desktop APP running through a browser window.
I took the easy route on this one. I created a small winform app, that coverts the GDI objects to a bitmap, and then I save the bitmap to a network share. This file is refenced in a simple HTML file that is displayed on the monitor.
I chose the winform app, because it makes it really easy for me to set this up in task manager, and run it every 10 minutes to update.

ASP.NET Web Architecture Design

The problem I'm having with writing a web application architecture is that I want separate components that work together. By this I simply mean, for example, a navigation bar and the actual page content (as well as a header, which is static) in ASP.NET.
Now, here's where it gets interesting:
There are no two pages the same
The navigation pages on every page have security on them on a user-by-user basis
The navigation has links to other locations
The problem I'm mainly having is that you've usually got to have a full web page in Visual Studio, and if you have portions i.e. excluding your <html> tags then Visual Studio will end up underlining everything as incorrect.
The way is this application is currently being dealt with is using frames (yes, frames) to keep everything separate, but working together. I want to move away from this, although the web system is very large, and very important in that it must be available 24/7.
Any ideas?
Have you looked at Master Pages in ASP.NET 2.0? These can be used in conjunction with User Controls, and the Site Map Navigation.
Master Pages Quickstart Tutorial
MSDN Overview
Master Pages: Tips, Tricks, and Traps
Example Template Set
There's a really good book you should check out that might shed some light on your problem. It's "ASP.NET 2.0 Website Programming: Problem - Design - Solution", part of the Wrox series.
Is it not possible to implement UserControls for this? for example a navigation user control that can handle the security for itself etc etc.
Hope this helps a little.

Resources