Search Results

Search found 15137 results on 606 pages for 'global state'.

Page 50/606 | < Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >

  • Domain entities into (ASP.NET) Session, or better some kind of DTOs?

    - by Robert
    Currently we put Domain Objects into our ASP.NET Sessions. Now we considering moving from InProc sessions to state server. This requires that all objects inside session are serializable. Instead to annotate all objects with the [Serializable] attribute, we thought about creating custom-session objects (DTO Session Objects?), which only contain the information we need: CONS: Entities must be reloaded, which requires additional DB round-trips PROS: Session State is smaller Session information is more specific (could be a CON) No unneeded annotation of Domain-Entities What do you think? Should we use some kind of DTOs to store inside the session, or should we stick with god old entities?

    Read the article

  • save UIImageView state & the save the Entire View

    - by adamprocter
    I have an iPad app where you add photos to a page. I then want to save the photos positions, then add further pages with more photo positions and eventually save all the pagesto be looked at later in a slideshow style. Can anyone advise 1. Saving UIImageView states when moving to new views (or swapping views) - I see this on using NSCoding iPhone - save UIImageView state - but am at a lose - any more examples ? 2. How to save the 'entire' set of view to look at later (like a slideshow) - no idea on where to start with this ? array ? coredata ? Thanks

    Read the article

  • Where does one get data like Country:(list) State:(list)

    - by rlb.usa
    As a programmer of data-entry forms of all kinds, I often find myself making fields for things like Country: <choose from list>, State: <choose from list>, Race/Ethnicity: <choose from list>. Consider: Perhaps a list the 50 United States names is an easy thing to find (does one include DC?) , but the countries are not. Nearly every site you find has a differing list with all of the political goings on over the years, and they become outdated quickly. What's the best/common practice regarding population of these kinds of lists? Where does this data come from if it's not given in the specs?

    Read the article

  • Why is my global security group being filtered out of my logon token?

    - by Jay Michaud
    While investigating the effects of filtered tokens on my file permissions, I noticed that one of my global security groups is being filtered in addition to the regular system-defined filtered groups. My Active Directory environment is a single-domain forest on the Windows Server 2003 functional level. I'll call the domain "mydomain.example.com". I am logged onto a Windows Server 2008 Enterprise Edition machine (not a domain controller) as a member of the "MYDOMAIN\Domain Admins" group and the "MYDOMAIN\MySecurityGroup" global security group (among others). When I run "whoami /groups" from an elevated command prompt, I see the full list of groups to which my account belongs as expected. When I run "whoami /groups" from a regular, non-elevated command prompt, I see the same list of groups, but the following groups are described as "Group used for deny only". BUILTIN\Administrators MYDOMAIN\Schema Admins MYDOMAIN\Offer Remote Assistance Helpers MYDOMAIN\MySecurityGroup Numbers 1 through 3 above are expected based on Microsoft documentation; number 4 is not. The "MYDOMAIN\MySecurityGroup" global security group is a group that I created. It contains three non-built-in global security groups, and these security groups contain only non-built-in user accounts. (That is, I created all of the accounts and groups that are members of the "MYDOMAIN\MySecurityGroup" global security group.) There are other, similar groups of which my account is a member that are not being filtered out of my logon token, and this group is not granted any specific user rights in the security settings of this computer or in Group Policy. What would cause this one group to be filtered out of my logon token?

    Read the article

  • Why is my global security group being filtered out of my logon token?

    - by Jay Michaud
    While investigating the effects of filtered tokens on my file permissions, I noticed that one of my global security groups is being filtered in addition to the regular system-defined filtered groups. My Active Directory environment is a single-domain forest on the Windows Server 2003 functional level. I'll call the domain "mydomain.example.com". I am logged onto a Windows Server 2008 Enterprise Edition machine (not a domain controller) as a member of the "MYDOMAIN\Domain Admins" group and the "MYDOMAIN\MySecurityGroup" global security group (among others). When I run "whoami /groups" from an elevated command prompt, I see the full list of groups to which my account belongs as expected. When I run "whoami /groups" from a regular, non-elevated command prompt, I see the same list of groups, but the following groups are described as "Group used for deny only". BUILTIN\Administrators MYDOMAIN\Schema Admins MYDOMAIN\Offer Remote Assistance Helpers MYDOMAIN\MySecurityGroup Numbers 1 through 3 above are expected based on Microsoft documentation; number 4 is not. The "MYDOMAIN\MySecurityGroup" global security group is a group that I created. It contains three non-built-in global security groups, and these security groups contain only non-built-in user accounts. (That is, I created all of the accounts and groups that are members of the "MYDOMAIN\MySecurityGroup" global security group.) There are other, similar groups of which my account is a member that are not being filtered out of my logon token, and this group is not granted any specific user rights in the security settings of this computer or in Group Policy. What would cause this one group to be filtered out of my logon token?

    Read the article

  • Is it safe to read global data from multiple threads?

    - by user362515
    The scenario is as follows: Create an instance of a class (std::map) and sore it as global variable. Spawn threads. Threads read and use the same global instance of the class All spawned threads quit Global class instance is destroyed No mutex, no thread modifies the global class instance. Is this OK? Thank You

    Read the article

  • Is it save to read global data from multiple threads?

    - by user362515
    The scenario is as follows: Create an instance of a class (std::map) and sore it as global variable. Spawn threads. Threads read and use the same global instance of the class All spawned threads quit Global class instance is destroyed No mutex, no thread modifies the global class instance. Is it ok? Thank You

    Read the article

  • HTML Canvas: Should my app x, y values be global?

    - by Joe
    I have a large file of functions. Each of these functions is responsible for drawing a particular part of the application. My app has x and y parameters that I use in the setup function to move the whole app around in order to try different placements. So, naturally, I need to use these x and y values to anchor each function's component rendering so that everything moves in unison if the global x,y values ever change. My question is, is it bad practice/architecture to have these x,y values in the global namespace and having the each function directly access them like so? function renderFace() { var x = App.x; var y = App.y; // drawing here } is there a better way i'm missing?

    Read the article

  • How do I enable or disable the global application menu?

    - by Michael Ekstrand
    I'm fairly excited for Unity, as it looks like a promising new direction for Ubuntu. However, I do have a concern - will it be possible to use Unity without the global menu? I have my window manager set to focus-follows-mouse/sloppy focus, and find the productivity gains to be immense. Sloppy focus is incompatible, however, with global menus, as it is possible for the focus to change while you move from window to menu. Will Unity support an option to use window menus while still using Unity?

    Read the article

  • Global Knowledge présente ses nouvelles formations sur le Cloud pour développeurs, DSI, chefs de projets, consultants ou architectes réseaux

    Global Knowledge présente ses nouvelles formations sur le Cloud Pour développeurs, DSI, chefs de projets, consultants ou architectes réseaux Global Knowledge, le centre de formation continue en informatique et management, vient d'ajouter de nouveaux cours sur le Cloud Computing à son catalogue de formations. On y trouve d'une part, un cursus certifiant de 21 jours conçu en partenariat avec Centrale Paris. Et d'autre part, un catalogue complet et structuré allant des fondamentaux (comprendre le Cloud Computing), à la conception d'une architecture ou encore la mise en oeuvre des solutions techniques comme la virtualisation. Elles s'adressent donc à un public la...

    Read the article

  • Need advice on OOP philosophy

    - by David Jenings
    I'm trying to get the wheels turning on a large project in C#. My previous experience is in Delphi, where by default every form was created at applicaton startup and form references where held in (gasp) global variables. So I'm trying to adapt my thinking to a 100% object oriented environment, and my head is spinning just a little. My app will have a large collection of classes Most of these classes will only really need one instance. So I was thinking: static classes. I'm not really sure why, but much of what I've read here says that if my class is going to hold a state, which I take to mean any property values at all, I should use a singleton structure instead. Okay. But there are people out there who for reasons that escape me, think that singletons are evil too. None of these classes is in danger of being used anywhere except in this program. So they could certainly work fine as regular objects (vs singletons or static classes) Then there's the issue of interaction between objects. I'm tempted to create a Global class full of public static properties referencing the single instances of many of these classes. I've also considered just making them properties (static or instance, not sure which) of the MainForm. Then I'd have each of my classes be aware of the MainForm as Owner. Then the various objects could refer to each other as Owner.Object1, Owner.Object2, etc. I fear I'm running out of electronic ink, or at least taxing the patience of anyone kind enough to have stuck with me this long. I hope I have clearly explained my state of utter confusion. I'm just looking for some advice on best practices in my situation. All input is welcome and appreciated. Thanks in advance, David Jennings

    Read the article

  • Trouble with Unions in C program.

    - by Jordan S
    I am working on a C program that uses a Union. The union definition is in FILE_A header file and looks like this... // FILE_A.h**************************************************** xdata union { long position; char bytes[4]; }CurrentPosition; If I set the value of CurrentPosition.position in FILE_A.c and then call a function in FILE_B.c that uses the union, the data in the union is back to Zero. This is demonstrated below. // FILE_A.c**************************************************** int main.c(void) { CurrentPosition.position = 12345; SomeFunctionInFileB(); } // FILE_B.c**************************************************** void SomeFunctionInFileB(void) { // After the following lines execute I see all zeros in the flash memory. WriteByteToFlash(CurrentPosition.bytes[0]; WriteByteToFlash(CurrentPosition.bytes[1]; WriteByteToFlash(CurrentPosition.bytes[2]; WriteByteToFlash(CurrentPosition.bytes[3]; } Now, If I pass a long to SomeFunctionInFileB(long temp) and then store it into CurrentPosition.bytes within that function, and finally call WriteBytesToFlash(CurrentPosition.bytes[n]... it works just fine. It appears as though the CurrentPosition Union is not global. So I tried changing the union definition in the header file to include the extern keyword like this... extern xdata union { long position; char bytes[4]; }CurrentPosition; and then putting this in the source (.c) file... xdata union { long position; char bytes[4]; }CurrentPosition; but this causes a compile error that says: C:\SiLabs\Optec Programs\AgosRot\MotionControl.c:76: error 91: extern definition for 'CurrentPosition' mismatches with declaration. C:\SiLabs\Optec Programs\AgosRot\/MotionControl.h:48: error 177: previously defined here So what am I doing wrong? How do I make the union global?

    Read the article

  • How to get more detail from an exception?

    - by cusimar9
    I have a .NET 4.0 web application which implements an error handler within the Application_Error event of Global.asax. When an exception occurs this intercepts it and sends me an email including a variety of information like the logged in user, the page the error occurred on, the contents of the session etc. This is all great but there is some fundamental detail missing which I seem unable to locate. For instance, this is a subset of an error I would receive and the associated stack trace: Source: Telerik.Web.UI Message: Selection out of range Parameter name: value Stack trace: at Telerik.Web.UI.RadComboBox.PerformDataBinding(IEnumerable dataSource) at Telerik.Web.UI.RadComboBox.OnDataSourceViewSelectCallback(IEnumerable data) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at Telerik.Web.UI.RadComboBox.OnDataBinding(EventArgs e) at Telerik.Web.UI.RadComboBox.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at Telerik.Web.UI.RadComboBox.DataBind() at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() at Telerik.Web.UI.RadComboBox.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) Now as lovely as this is I could do with knowing a) the name of the control and b) the value which caused the control to be 'out of range'. Any suggestions about how I could get this sort of information? I've run this in debug mode and the objects passed to Global.asax don't seem to hold any more detail that I can see.

    Read the article

  • Exception "The operation is not valid for the state of the transaction" using TransactionScope

    - by Lanfear
    We have a web service on server #1 and a database on server #2. Web service uses transaction scope to produce distributed transaction. Everything is correct. And we have another database on server #3. We had some problems with this server and we reinstalled operation system and software. We configured MSDTC and tried to use web service from server #1 to communicate with database on this server. And now after first select statement within transaction scope we get: "The operation is not valid for the state of the transaction". This exception falls in every web service request if it is using transaction scope. Server #2 and Server #3 is almost similar. The difference can be only in settings. .NET framework 3.5 SP1 installed and SQL Server SP3 on all servers. Full stacktrace: System.Transactions.TransactionState.EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction) ? System.Transactions.Transaction.EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification promotableSinglePhaseNotification) ? System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction t ? System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction t ? System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction) ? System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction) ? System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) ? System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) ? System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) ? System.Data.SqlClient.SqlConnection.Open() ? NHibernate.Connection.DriverConnectionProvider.GetConnection() ? NHibernate.Impl.SessionFactoryImpl.OpenConnection() I searched this message but didn't found any appropriate solution. So what settings should I check and what exactly should I do to fix it?

    Read the article

  • WCF: Manually configuring Binding and Endpoint causes SerciveChannel Faulted State

    - by Matthias
    Hi there, I've created a ComVisible assembly to be used in a classic-asp application. The assembly should act as a wcf client and connect to a wcf service host (inside a windows service) on the same machine using named pipes. The wcf service host works fine with other clients, so the problem must be within this assembly. In order to get things work I added a service reference to the ComVisible assembly and proxy classes and the corresponding app.config settings were generated for me. Everything fine so far except that the app config would not be recognized when doing an CreateObject with my assembly in the asp code. I went and tried to hardcode (just for testing) the Binding and Endpoint and pass those two to the constructor of my ClientBase derived proxy using this code: private NetNamedPipeBinding clientBinding = null; private EndpointAddress clientAddress = null; clientBinding = new NetNamedPipeBinding(); clientBinding.OpenTimeout = new TimeSpan(0, 1, 0); clientBinding.CloseTimeout = new TimeSpan(0, 0, 10); clientBinding.ReceiveTimeout = new TimeSpan(0, 2, 0); clientBinding.SendTimeout = new TimeSpan(0, 1, 0); clientBinding.TransactionFlow = false; clientBinding.TransferMode = TransferMode.Buffered; clientBinding.TransactionProtocol = TransactionProtocol.OleTransactions; clientBinding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard; clientBinding.MaxBufferPoolSize = 524288; clientBinding.MaxBufferSize = 65536; clientBinding.MaxConnections = 10; clientBinding.MaxReceivedMessageSize = 65536; clientAddress = new EndpointAddress("net.pipe://MyService/"); MyServiceClient client = new MyServiceClient(clientBinding, clientAddress); client.Open(); // do something with the client client.Close(); But this causes the following error: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the faulted state. The environment is .Net Framework 3.5 / C#. What am I missing here?

    Read the article

  • How do I save an Android application's state?

    - by Bernard
    I've been playing around with the Android SDK, and I am a little unclear on saving an applications state. So given this minor re-tooling of the 'Hello, Android' example: package com.android.hello; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class HelloAndroid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mTextView = new TextView(this); if (savedInstanceState == null) { mTextView.setText("Welcome to HelloAndroid!"); } else { mTextView.setText("Welcome back."); } setContentView(mTextView); } private TextView mTextView = null; } I thought that might be all one needed to do for the simplest case, but it always gives me the first message, no matter how I navigate away from the app. I'm sure it's probably something simple like overriding onPause or something like that, but I've been poking away in the docs for 30 minutes or so and haven't found anything obvious, so would appreciate any help. Cue me looking a fool in three, two, one... Thanks.

    Read the article

  • HTML.CheckBox persisting state after POST - Refresh ModelState?

    - by Kirschstein
    I have a form that's made up of many items (think order items on an amazon order). Each row has a checkbox associated with them so the user can select many items and click 'remove'. The form is built up a bit like this; <% for (int i = 0; i < Model.OrderItems.Count; i++) { %> <tr> <td><%= Html.Hidden(String.Format("OrderItems[{0}].Id", i), Model.OrderItems[i].Id)%> <%= Html.CheckBox(String.Format("OrderItems[{0}].Checked", i), Model.OrderItems[i].Checked)%></td> <td><%= Html.TextBox(String.Format("OrderItems[{0}].Name", i), Model.OrderItems[i].Name)%></td> <td><%= Html.TextBox(String.Format("OrderItems[{0}].Cost", i), Model.OrderItems[i].Cost)%></td> <td><%= Html.TextBox(String.Format("OrderItems[{0}].Quantity", i), Model.OrderItems[i].Quantity)%></td> </tr> <% } %> The model binder does its magic just fine and the list is correctly populated. However, after I process the request in the action (e.g. remove the appropriate items) and return a new view containing fewer items, the state of the form is 'semi' persisted. Some check boxes remain checked, even though in the edit model all the bools are set to false. I don't have this problem if I return a RedirectToActionResult, but using that as a solution seems a bit of a hacky work around. I think I need to flush/refresh the ModelState, or something similiar, but I'm unsure of the terms to search for to find out how.

    Read the article

  • Determining whether geographic point is within X meters of a state border (using shapefile for borde

    - by DanM
    So I'm writing a Java app, and I've got an ESRI Shapefile which contains the borders of all the U.S. states. What I need is to be able to determine whether any given lat/lon point is within a specified distance from ANY state border line - i.e., I will not be specifying a particular border line, just need to see whether the point is close to any of them. The solution does NOT have to be very precise at all; e.g. I don't need to be dealing with measuring perpendicular to the border, or whatever. Just checking to see if going X meters north, south, east or west would result in crossing a border would be more than sufficient. The solution DOES have to be computationally efficient, as I'll be performing a huge number of these calculations. I'm planning to use the GeoTools library (though if there's a simpler option, I'm all for it) with the Shapefile plugin. What I don't really understand is: Once I've got the shapefile loaded into memory, how do I check to see whether I'm near a border? Thanks! -Dan

    Read the article

  • Programatic re-evalutation of MVVM command's "can execute" state

    - by dzs
    Hello! I'm writing a WPF application using the MVVM pattern, based on the following article: WPF Apps With The Model-View-ViewModel Design Pattern I have two buttons on my View with the buttons' "Command" property bound (with data binding) to a given instance of the RelayCommand class (see "Figure 3 The RelayCommand Class" from the article above). The RelayCommand class has support for checking whether the given command can be executed. WPF automatically disables buttons whose command cannot be executed. Each of my commands (in the ViewModel class) start a background operation, and the command cannot be executed again until the background operation is finished. The RelayCommand instances have information whether the background operation is still working or it is finished. My problem is the following: after pressing the any of the buttons, the buttons automaticaly go disabled (which is OK) because the background operation started and the command cannot be executed until it is finished, but after the operation had finished, the buttons don't go enabled automatically because their command's "can be executed" predicate is not automatically reevaluated. The reevaluation can be manually triggered by having the application loose and regain focus (by pressing ALT+TAB). After doing this trick, the buttons get enabled once again. How can I programatically reevaluate the buttons' command's "can execute" state?

    Read the article

  • PostgreSQL - Error: SQL state: XX000.

    - by rob
    I have a table in Postgres that looks like this: CREATE TABLE "Population" ( "Id" bigint NOT NULL DEFAULT nextval('"population_Id_seq"'::regclass), "Name" character varying(255) NOT NULL, "Description" character varying(1024), "IsVisible" boolean NOT NULL CONSTRAINT "pk_Population" PRIMARY KEY ("Id") ) WITH ( OIDS=FALSE ); And a select function that looks like this: CREATE OR REPLACE FUNCTION "Population_SelectAll"() RETURNS SETOF "Population" AS $BODY$select "Id", "Name", "Description", "IsVisible" from "Population"; $BODY$ LANGUAGE 'sql' STABLE COST 100 Calling the select function returns all the rows in the table as expected. I have a need to add a couple of columns to the table (both of which are foreign keys to other tables in the database). This gives me a new table def as follows: CREATE TABLE "Population" ( "Id" bigint NOT NULL DEFAULT nextval('"population_Id_seq"'::regclass), "Name" character varying(255) NOT NULL, "Description" character varying(1024), "IsVisible" boolean NOT NULL, "DefaultSpeciesId" bigint NOT NULL, "DefaultEcotypeId" bigint NOT NULL, CONSTRAINT "pk_Population" PRIMARY KEY ("Id"), CONSTRAINT "fk_Population_DefaultEcotypeId" FOREIGN KEY ("DefaultEcotypeId") REFERENCES "Ecotype" ("Id") MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT "fk_Population_DefaultSpeciesId" FOREIGN KEY ("DefaultSpeciesId") REFERENCES "Species" ("Id") MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ) WITH ( OIDS=FALSE ); and function: CREATE OR REPLACE FUNCTION "Population_SelectAll"() RETURNS SETOF "Population" AS $BODY$select "Id", "Name", "Description", "IsVisible", "DefaultSpeciesId", "DefaultEcotypeId" from "Population"; $BODY$ LANGUAGE 'sql' STABLE COST 100 ROWS 1000; Calling the function after these changes results in the following error message: ERROR: could not find attribute 11 in subquery targetlist SQL state: XX000 What is causing this error and how do I fix it? I have tried to drop and recreate the columns and function - but the same error occurs. Platform is PostgreSQL 8.4 running on Windows Server. Thanks.

    Read the article

  • Android - Lifecycle and saving an Instance State questions

    - by The Salt
    So within my application is a form for creating a new user, with relevant details and information about the user. There's no problems there, it's just what happens when the user leaves the activity without pressing the confirm button. Here's what I want to do: If the user presses the back button, attempt to save all the data to the database and inform the user. If the activity is interrupted (ie by a phone call), save all the data into a temporary location so when the activity is at the top of the stack again, nothing appears to have changed (but the data still hasn't yet been saved to the database). If the activity gets killed for more resources when in the background, do the same as point 2 above (ie when the activity is started again, it appears that nothing has changed). If the whole application is started again (by clicking on the icon again) and there is temporary data stored from either points 2 or 3 above, navigate to the "create user" activity and display data as if nothings changed. Here's how I'm currently trying to do it: Use onDestroy() and isFinishing() functions to find when the activity is being killed, to cover point 1 above (to then try and save all data). Save all data with onSaveInstanceState into a bundle (to cover point 2 above) Does the bundle created with onSaveInstanceState survive the activity being killed for more resources, so when its recreated the previous state can be retrieved (as in point 3 above)? No idea how to implement point 4. Any help would be massively appreciated. Cheers!

    Read the article

  • State Animation on ListBox ItemTemplate

    - by Peanut
    I have a listbox which reads from Observable collection, and is ItemTemplate'ed: <DataTemplate x:Key="DataTemplate1"> <Grid x:Name="grid" Height="47.333" Width="577" Opacity="0.495"> <Image HorizontalAlignment="Left" Margin="10.668,8,0,8" Width="34" Source="{Binding ImageLocation}"/> <TextBlock Margin="56,8,172.334,8" TextWrapping="Wrap" Text="{Binding ApplicationName}" FontSize="21.333"/> <Grid x:Name="grid1" HorizontalAlignment="Right" Margin="0,10.003,-0.009,11.33" Width="26" Opacity="0" RenderTransformOrigin="0.5,0.5"> <Image HorizontalAlignment="Stretch" Margin="0" Source="image/downloads.png" Stretch="Fill" MouseDown="Image_MouseDown" /> </Grid> </Grid> </DataTemplate> <ListBox x:Name="searchlist" Margin="8" ItemTemplate="{DynamicResource DataTemplate1}" ItemsSource="{Binding SearchResults}" SelectionChanged="searchlist_SelectionChanged" ItemContainerStyle="{DynamicResource ListBoxItemStyle1}" /> In general, my question is "What is the easiest way to do Animation on Particular Items in this listbox As they are selected? Basically the image inside the "grid1" will be setting its opacity to 1, slowly. I would prefer to use states, but I do not know of any way to just tell blend and xaml to "When a selected item is changed, change the image opacity to 1 over a period of .3 seconds". Infact, I have been doing this in the .cs file using the VisualStateManager. Also, there is another issue. When the selected index is changed, we goto the CS file and look at SelectedItem. SelectedItem returns an instance of the Object in which it was bound to (The object inside the observable collection), and NOT an instance of the DataTemplate/ListItem etc. So how am I able to pull the correct image out of this list? State animation with VisualStateManager I can handle fine if its just normal things, but when it comes to generated listboxes' items, I'm lost. Thanks

    Read the article

  • submitting the form even if the form is in invalid state

    - by Abu Hamzah
    i am using asp.net web forms and i am using bassistance.de jquery validation.. i have bunch of fields in the form and its validatating how it suppose to but its still executing my code behind code, why is it doing that? here is my code: form: <script type="text/javascript"> $(document).ready(function() { $("#aspnetForm").validate({ rules: { <%=txtVisitName.UniqueID %>: { maxlength:1, //minlength: 12, required: true } ................. }, messages: { <%=txtVisitName.UniqueID %>: { required: "Enter visit name", minlength: jQuery.format("Enter at least {0} characters.") } ............ }, success: function(label) { label.html("&nbsp;").addClass("checked"); } }); $("#aspnetForm").validate(); }); </script> <div > <h1> Page</h1> <asp:Label runat="server" ID='Label1'>Visit Name:</asp:Label> <asp:TextBox ID="txtVisitName" runat='server'></asp:TextBox> ............ ............... <button id="btnSubmit" name="btnSubmit" type="submit"> Submit</button> </div> and i have a external .js file referencing to my web form page. $(document).ready(function() { $("#btnSubmit").click(function() { SavePage(); }); }); i have a WebMethod .cs and i have bookmark and it does hitting that line of code even thoug my page is in invalid state. how would i fix this? thanks.

    Read the article

  • Properly maintain sorted state of Array/Set

    - by Jeff
    I'm trying to get data out of my MOC and then create some new objects based on those objects, and put it all back together, while keeping my sort state. The securities come out of the MOC in proper order. And everything seems to be fine until I do the assignment to the game at the bottom from setWithArray. The documentation says that setWithArray removed the duplicate objects, if there are any. I'm wonder if that's messing up my data, but I don't see a good alternative. The data is ultimately being pulled out into a UITableView. When I add items to the game manually, then they stay sorted, so I don't think the breaking of the sort is beyond the scope of what I've included here. NSError *error; NSArray *allTheSecurities = [managedObjectContext executeFetchRequest:request error:&error]; if (allTheSecurities == nil) { // Handle the error. } [request release]; /**/ NSLog( @"Enumerate..." ); NSEnumerator *enumerator = [allTheSecurities objectEnumerator]; id anObject; NSMutableArray *portfolioStocks = [[NSMutableArray alloc] init]; while (anObject = [enumerator nextObject]) { NSLog( @"Iteration... %@", [anObject name] ); NSLog( @"Build a stock..." ); PortfolioStocks *this_stock = (PortfolioStocks *)[NSEntityDescription insertNewObjectForEntityForName:@"PortfolioStocks" inManagedObjectContext:context]; NSLog( @"Set a value..." ); [this_stock setSecurity:(Security *)anObject]; [this_stock setQuantity:[NSNumber numberWithInt:0]]; NSLog( @"Add to portfolioStocks..." ); [portfolioStocks addObject:this_stock]; } //Sorted properly up to here! NSLog( @"Add to portfolio..." ); [game setPortfolio:[NSSet setWithArray:portfolioStocks]]; // <-- This is where it's not sorted anymore.

    Read the article

  • submittingthe form even if the form is in invalid state

    - by Abu Hamzah
    i am using asp.net web forms and i am using bassistance.de jquery validation.. i have bunch of fields in the form and its validatating how it suppose to but its still executing my code behind code, why is it doing that? here is my code: form: <script type="text/javascript"> $(document).ready(function() { $("#aspnetForm").validate({ rules: { <%=txtVisitName.UniqueID %>: { maxlength:1, //minlength: 12, required: true } ................. }, messages: { <%=txtVisitName.UniqueID %>: { required: "Enter visit name", minlength: jQuery.format("Enter at least {0} characters.") } ............ }, success: function(label) { label.html("&nbsp;").addClass("checked"); } }); $("#aspnetForm").validate(); }); </script> <div > <h1> Page</h1> <asp:Label runat="server" ID='Label1'>Visit Name:</asp:Label> <asp:TextBox ID="txtVisitName" runat='server'></asp:TextBox> ............ ............... <button id="btnSubmit" name="btnSubmit" type="submit"> Submit</button> </div> and i have a external .js file referencing to my web form page. $(document).ready(function() { $("#btnSubmit").click(function() { SavePage(); }); }); i have a WebMethod .cs and i have bookmark and it does hitting that line of code even thoug my page is in invalid state. how would i fix this? thanks.

    Read the article

< Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >