Search Results

Search found 4498 results on 180 pages for 'expression'.

Page 34/180 | < Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >

  • When to use UserControl vs. Control in Silverlight?

    - by Dov
    I'm just getting my feet wet in Silverlight, and don't really understand the differences and pros/cons of creating a UserControl vs. creating a Control for the same task (as in when you right click on a selection in Expression Blend, for instance). It seems like selecting "Make Into Control" just creates a new template for the base type you specify, whereas creating a UserControl creates a whole new base class. Is that correct? In this particular instance, I'm creating a custom text box control that only takes numbers, and divides itself into 3 sections, storing 3 values into separate properties as pictured below. In this particular case, which would be best? Update (Additional Question): Why can't I use Template Binding with a UserControl, but I can with a Control? That's one reason I thought that making a UserControl might not be the right decision.

    Read the article

  • typesafe NotifyPropertyChanged using linq expressions

    - by bitbonk
    Form Build your own MVVM I have the following code that lets us have typesafe NotifyOfPropertyChange calls: public void NotifyOfPropertyChange<TProperty>(Expression<Func<TProperty>> property) { var lambda = (LambdaExpression)property; MemberExpression memberExpression; if (lambda.Body is UnaryExpression) { var unaryExpression = (UnaryExpression)lambda.Body; memberExpression = (MemberExpression)unaryExpression.Operand; } else memberExpression = (MemberExpression)lambda.Body; NotifyOfPropertyChange(memberExpression.Member.Name); } How does this approach compare to standard simple strings approach performancewise? Sometimes I have properties that change at a very high frequency. Am I safe to use this typesafe aproach? After some first tests it does seem to make a small difference. How much CPU an memory load does this approach potentially induce?

    Read the article

  • Sketchflow component target parent state

    - by user186106
    Hi, I'm using Sketchflow in Expression Blend 4 RC (although this is relevant to Blend 3 too). I have a screen with a datagrid on it (MainScreen) and there's a "New" button. I have a component screen that has a generic form (GenericForm) and a "Save and close" button. I have two states on MainScreen: State1 (and default): GenericForm visibility set to Hidden State2: GenericForm visibility set to Visible The "New" button on MainScreen has: Active State = State2, meaning when the "New" button is pressed, it changes the state of MainScreen to State2 (where the GenericForm component is visible). My problem is that I cannot link the "Save and close" button on GenericForm to State1 on MainScreen. In effect I would like to be able to press "Save and close" and for the MainScreen to set its state to State1. Any ideas?

    Read the article

  • Xaml not WPF

    - by xan
    I am interested in using Xaml with expression blend for creating user interfaces in an application. However, because of the limitations of the target architecture, I cannot use WPF or C#. So, what I am interested in is in any examples / existing projects or advice from anyone who has experiance of this technology on the use of Xaml in it's "Pure" form as a specification language not tied to WPF. Specific questions: 1) Is it possible to use Blend + Xaml without the WPF elements, or without C# backing classes? 2) Are there any other implementations of Xaml parsers etc. which use different architectures, and can they work with blend or similar tools. 3) Are there alternative editor / designer tools which can help in this situation? I am aware of the MyXaml and MycroXaml projects, and have found a lot of resources on the web about Xaml, but 99% of it relates directly to WPF. This is fine for understanding the concepts of Xaml, but doesn't help with the implimentation I need. Many thanks!

    Read the article

  • The property 'IsDataSource' was not found in type 'ViewModelLocator

    - by dieter-preconsult-be
    Hello I have the following code: <UserControl x:Class="TestApp.View.ViewAlarmLog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:Custom="http://schemas.microsoft.com/wpf/2008/toolkit" xmlns:mvvm="clr-namespace:Test.ViewModel"> <UserControl.Resources> <ResourceDictionary > <ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries> <mvvm:ViewModelLocator x:Key="Locator" d:IsDataSource="True"/> </ResourceDictionary> </UserControl.Resources> the problem is dat i always get an error: The property 'IsDataSource' was not found in type 'ViewModelLocator'. " What could be the problem here ? Redgards Dieter

    Read the article

  • How do I programmatically set property of control in aspx file ?

    - by Thomas Wanner
    This may be a very dumb question but I can't seem to get it working. I use at many places the following syntax for dynamically binding a property of a control in aspx file to the resource entry, e.g. <SomeFunnyControl Text="<%$ Resources : ResClass, ResEntry %>" /> I want to do a similar thing with a class containing some constants, something like <SomeFunnyControl Text="<%= MyConstantsClass.MyStringConstant %>" /> But this doesn't seem to work, it simply sets the text to the exact expression without evaluating it. I am using ASP.NET 3.5 btw. I have tried the databinding approach but I get an HttpParseException saying Databinding expressions are only supported on objects that have a DataBinding event.

    Read the article

  • Java Counting # of occurrences of a word in a string

    - by Doug
    I have a large text file I am reading from and I need to find out how many times some words come up. For example, the word "the". I'm doing this line by line each line is a string. I need to make sure that I only count legit "the"'s the the in other would not count. This means I know I need to use regular expressions in some way. What I was trying so far is this: numSpace += line.split("[^a-z]the[^a-z]").length; I realize the regular expression may not be correct at the moment but I tried without that and just tried to find occurrences of the word the and I get wrong numbers to. I was under the impression this would split the string up into an array and how many times that array was split up was how many times the word is in the string. Any ideas I would be grateful.

    Read the article

  • convert string to dict using list comprehension in python

    - by Pavel
    I have came across this problem a few times and can't seem to figure out a simple solution. Say I have a string string = "a=0 b=1 c=3" I want to convert that into a dictionary with a, b and c being the key and 0, 1, and 3 being their respective values (converted to int). Obviously I can do this: list = string.split() dic = {} for entry in list: key, val = entry.split('=') dic[key] = int(val) But I don't really like that for loop, It seems so simple that you should be able to convert it to some sort of list comprehension expression. And that works for slightly simpler cases where the val can be a string. dic = dict([entry.split('=') for entry in list]) However, I need to convert val to an int on the fly and doing something like this is syntactically incorrect. dic = dict([[entry[0], int(entry[1])] for entry.split('=') in list]) So my question is: is there a way to eliminate the for loop using list comprehension? If not, is there some built in python method that will do that for me?

    Read the article

  • Is both approach same ?

    - by Harikrishna
    I have one datatable which is not bindided and records are coming from the file by parsing it in the datatable dynamically every time. Now there is three columns in the datatable Marks1,Marks2 and FinalMarks. And their types is decimal. Now for making addition of columns Marks1 and Marks2 's records and store it into FinalMarks column,For that what I do is : datatableResult.Columns["FinalMarks"].Expression="Marks1+Marks2"; It's works properly. It can be done in other way also is foreach (DataRow r in datatableResult.Rows) { r["FinalMarks"]=Convert.ToDecimal(r["Marks1"])+Convert.ToDecimal(r["Marks2"]); } Now I don't know that which is the best way to do this means performance wise. Is first approach same as second approach in background means is both approach same or what?

    Read the article

  • Icons in Silverlight: Images vs. Vectors

    - by Shnitzel
    I like using the vector drawing feature of Expression Blend to create icons. That way I can change colors easily on my icons without having to resort to an image editor. But my question is... Say I have a treeview control that has an icon next to each tree element and say I have hundreds of elements. Do you think using images is faster - performance wise than using vector icons? B/c I'd rather use vectors but I'm wondering about performance concerns.

    Read the article

  • wrong font in a RichTextBox importing from .rtf

    - by giacomellow
    Hi all, I'm developing a microsoft surface application using expression blend+vs 2008. I have a RichTextBox that loads formatted text from an .rtf file. The text is formatted with uppecases, color, and specific font (helvetica-neue). When i load the text, it is displayed in the control with matching format (color and uppecase) but NOT matching font. it seems to use the standard Blend font (Thaoma). the text is loaded with this function: public static RichTextBox SetRTFText(string text, RichTextBox richTextBox) { MemoryStream stream = new MemoryStream(ASCIIEncoding.Default.GetBytes(text)); TextRange documentTextRange = new TextRange(richTextBox.Document.ContentStart, richTextBox.Document.ContentEnd); documentTextRange.Load(stream, DataFormats.Rtf ); return richTextBox; } thank you all!

    Read the article

  • Using module include in OCaml

    - by Geoff
    In OCaml 3.11, I want to "extend" an existing module using the include directive, like so: module MyString = struct include String let trim s = ... end No problem. But now I want to expose this module's type explicitly (i.e. in a .mli file). I want something like this: module MyString : sig include String val trim : string -> string end But the include syntax is not correct because String refers to a module, not a module type (and the compiler does indeed barf). How can I refer to the module type for String here (without having write it out explicitly in a sig expression)? Thanks!

    Read the article

  • XPath 1.0 to find if an element's value is in a list of values

    - by user364902
    Is there a way to construct an XPath that evaluates whether an element's value is in a predefined list of values? Something akin to this: /Location/Addr[State='TX or AL or MA'] Which would match nodes whith State elements for Texas, Alabama, or Massachusetts? I know that I can unpack the expression: /Location/Addr[State='TX] or /Location/Addr[State='AL'], etc... But this is a bit cumbersome since the xpaths are quite long, as is the list of values. My google-fu isn't turning up much on the issue...

    Read the article

  • c# short if statement not working with int? (int=null)

    - by kobe
    I am trying to shorten my code by using short-if: int? myInt=myTextBox.Text == "" ? null : Convert.ToInt32(myTextBox.Text); But I'm getting the following error: Type of conditional expression cannot be determined because there is no implicit conversion between '' and 'int' The following works: int? myInt; if (myTextBox.Text == "") //if no text in the box myInt=null; else myInt=Convert.ToInt32(myTextBox.Text); And if I replace the 'null' in integer (say '4') it also works: int? myInt=myTextBox.Text == "" ? 4: Convert.ToInt32(myTextBox.Text);

    Read the article

  • Regex doesn't work properly

    - by oneofthelions
    I am trying to implement a regular expression to allow only one or two digits after a hyphen '-' and it doesn't work properly. It allows as many digits as user types after '-' Please suggest my ExtJS Ext.apply(Ext.form.VTypes, { hyphenText: "Number and hyphen", hyphenMask: /[\d\-]/, hyphenRe: /^\d+-\d{1,2}$/, hyphen: function(v){ return Ext.form.VTypes.hyphenRe.test(v); } }); //Input Field for Issue no var <portlet:namespace/>issueNoField = new Ext.form.TextField({ fieldLabel: 'Issue No', width: 120, valueField:'IssNo', vtype: 'hyphen' }); This works only to the limit that it allows digits and -. But it also has to allow only 1 to 2 digits after - at most. Is something wrong in my regex? hyphenRe: /^\d+-\d{1,2}$/,

    Read the article

  • C# - null vs "Could not evaluate expression"

    - by Vaccano
    I have code like this: private Box mCurBox; public Box CurBox { get { return mCurBox; } set { if (mCurBox != value) { mCurBox = value; } } } When mCurBox is null then CurBox the debugger says "Could not be evaluated". If it knows that the value underneath is null then how come it can't figure it out?

    Read the article

  • A pattern matching an expression that doesn't end with specific sequence

    - by patryk
    I need a regex pattern which matches such strings that DO NOT end with such a sequence: \.[A-z0-9]{2,} by which I mean the examined string must not have at its end a sequence of a dot and then two or more alphanumeric characters. For example, a string /home/patryk/www and also /home/patryk/www/ should match desired pattern and /home/patryk/images/DSC002.jpg should not. I suppose this has something to do with lookarounds (look aheads) but still I have no idea how to make it. Any help appreciated.

    Read the article

  • SSIS IsNumeric expression Error

    - by rmdussa
    Hi am using following exression in ssis package !ISNULL((DT_I4)Route) ? (DT_WSTR,50)("SB" + SUBSTRING(RIGHT(Route,2),1,1)) : (DT_WSTR,50)Route when the Route value is Numeric it is sucess, when it is Non-numeric failing with following description. Any help,how to resolve this issue [Derived Column [111]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "component "Derived Column" (111)" failed because error code 0xC0049067 occurred, and the error row disposition on "output column "column_New" (679)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure. [SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Derived Column" (111) failed with error code 0xC0209029 while processing input "Derived Column Input" (112). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.

    Read the article

  • Limit user input to allowable comma delimited words with regular expression using javascript

    - by Marc
    I want to force the user to enter any combination of the following words. the words need to be comma delimited and no comma at the beginning or end of the string the user should only be able to enter one of each word. Examples admin basic,ectech admin,ectech,advanced basic,advanced,admin,ectech my attempt ^((basic|advanced)|admin|ectech)((,basic|,advanced)|,admin|,ectech){0,2}$ Thanks Marc

    Read the article

  • XSLT: Regular Expression function does not work?

    - by Fedor Steeman
    Ok, this one has been driving me up the wall... I have a xslt function that is supposed to split out the Zip-code part from a Zip+City string depending on the country. I cannot get it to work! This is what I got so far: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exslt="http://exslt.org/functions" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsl:function name="exslt:GetZip" as="xs:string"> <xsl:param name="zipandcity" as="xs:string"/> <xsl:param name="countrycode" as="xs:string"/> <xsl:choose> <xsl:when test="$countrycode='DK'"> <xsl:analyze-string select="$zipandcity" regex="(\d{4}) ([A-Za-zÆØÅæøå]{3,24})"> <xsl:matching-substring> <xsl:value-of select="regex-group(1)"/> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:text>fail</xsl:text> </xsl:non-matching-substring> </xsl:analyze-string> </xsl:when> <xsl:otherwise> <xsl:text>error</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:function> I am running it on a source XML where the following values are passed to the function: zipandcity: "DK-2640 København SV" countrycode: "DK" ...will output 'fail'! I think there is something I am misunderstanding here...

    Read the article

  • Wincap capture filtering expression syntax

    - by cpx
    How would specify a syntax for filtering tcp server port with its ip address? const char *packet_filter = "tcp src port 2054"; bpf_u_int32 netmask; bpf_program fcode; if (d->addresses != NULL) /* Retrieve the mask of the first address of the interface */ netmask=((struct sockaddr_in *)(d->addresses->netmask))->sin_addr.S_un.S_addr; else /* If the interface is without an address we suppose to be in a C class network */ netmask=0xffffff; //compile the filter if (pcap_compile(adhandle, &fcode, packet_filter, 1, netmask) < 0) { fprintf(stderr,"\nUnable to compile the packet filter. Check the syntax.\n"); /* Free the device list */ pcap_freealldevs(alldevs); return -1; } //set the filter if (pcap_setfilter(adhandle, &fcode) < 0) { fprintf(stderr,"\nError setting the filter.\n"); /* Free the device list */ pcap_freealldevs(alldevs); return -1; }

    Read the article

  • java Regular expression matching html

    - by user121196
    I want to match and capture the enclosing content of the <pre></pre> tag tried the following, not working, what's wrong? String p="<pre>.*</pre>"; Matcher m=Pattern.compile(p,Pattern.MULTILINE|Pattern.CASE_INSENSITIVE).matcher(input); if(m.find()){ String g=m.group(0); System.out.println("g is "+g); }

    Read the article

  • group expression in jasper reports

    - by ed1t
    I've a report which has a has 5 columns on each page and I have a group defined which shows columns related to A | B | C | D | E - main column X | Y | Z - group - A is the key I have my query ORDER BY A, but when it is displayed it doesn't print the results in next page if A is changed. Following is how I have a group defined. <group name="A" isResetPageNumber="true" > <groupExpression><![CDATA[$F{A}]]></groupExpression> <groupHeader> <band/> </groupHeader> <groupFooter> <band/> </groupFooter> </group> does A need to be part of the group?

    Read the article

< Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >