I have a table tbls
with a field name
containing names of tables.
I'm trying to form a statement to get the number of rows of each of this tables.
Should I use a stored procedure or is there a simpler way to do it?
I have a table tbls
with a field name
containing names of tables.
I'm trying to form a statement to get the number of rows of each of this tables.
Should I use a stored procedure or is there a simpler way to do it?
I have big database that I use on my website and I would like to use it on android application without internet connection.
My database can export to .db file. How should I do to use this file for my android app.
Regards
I ran into a very disturbing issue that's been puzzling me for a while and I was wondering if anyone could give me some insight on this.
Basically, what I'm trying to do is set up an embedded ActiveMQ broker in the Spring context of one of my OSGi bundles (in Felix). I have downloaded the bundle and all dependencies listed in this page. They are all up and running. Here's what my Spring context xml file looks like:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jms="http://www.springframework.org/schema/jms"
xmlns:amq="http://activemq.apache.org/schema/core"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/osgi-compendium http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-2.5.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<!-- some uninteresting parts ommited -->
<!-- JMS Configurations -->
<amq:broker useJmx="false" start="true">
<amq:transportConnectors>
<amq:transportConnector uri="tcp://localhost:0"/>
</amq:transportConnectors>
</amq:broker>
<!-- other ActiveMQ configs such as destinations and whatnot -->
This looks pretty ok to me. However, during the startup I get the following message:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 41 in XML document from URL [bundle://121.0:0/META-INF/spring/bundle-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'amq:broker'.
I've found someone experiencing a similar issue in Eclipse (which I'm also using) and they apparently solved it by making Eclipse point to the bundled .xsd file in the ActiveMQ jar. I attempted to do the same, alas, to no avail.
Does anybody have any ideas on what i might be missing here?
Thanks in advance.
I want the contents of a link get printed by jQuery. How to do it?
Following is my code:
DEMO:
<a href="#" onclick="window.print(); return false;">Print</a>
?
$(document).ready(function() {
$('ul#tools').prepend('<li class="print"><a href="#print">Click me to print</a></li>');
$('ul#tools li.print a').click(function() {
window.open('www.google.com');
window.print();
return false;
});
}); ?
I have an array ( double ) : ox_test with a known number of elements.
when I code :
Array.Sort(ox_test);
and then, just to see if the array it's sorted :
for (int y = 1; y <= ox_test.Length; y++)
MessageBox.Show(".x: " + ox_test[y]);
.. I get ... 0, 0, 0, 0, 0 ( if the number of elements was 5 ). Please help, thank you!
So i modified the both for loops:
for (int y = 0; y < ox_test.Length; y++)
MessageBox.Show(".x: " + ox_test[y]);
// HERE i get the values not sorted but != 0
Array.Sort(ox_test);
for (int y = 0; y < ox_test.Length; y++)
MessageBox.Show(".x s: " + ox_test[y]);
// HERE i get only 0 values
I have UIViewController that contains NSMutableArray , I want to pass this array to UITableViewController and view it on the table .. how can I do that ??
I mean I want to (pass) NSMutableArray or any Varilable from UIViewController to UITableViewController not (create) a table
I'm working on an iPhone app that allows the user to browse a product catalogue. Potentially, this catalogue could hold 1000+ items. Every product is related to a Brand, and have some attributes such as color, size etc.
I'm think of pre-populating a SQLlite DB and including it in my app's bundle, then, like in CoreDataBooks example, on the first launch I'll use the NSPersistentStoreCoordinator
to check if the database has been created, and if not copy the default database to the desired location and move on.
But the product catalogue needs to be updated, and since the database will hold other information that the user added - like add a product to favorite etc., I don't want to overwrite the database once it has been initialized (from the default).
So I was thinking about using the network, calling a webservice, but wouldn't that be way to heavy on the network? It should be fast to browse products, and I fear that relying on webservices will slow down things unacceptably?
I am trying to query solr via solrj in Eclipse.
I have tried the latest solrj wiki example:
import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.params.ModifiableSolrParams;
import java.net.MalformedURLException;
public class SolrQuery2 {
public static void main(String[] args) throws MalformedURLException, SolrServerException {
SolrServer solr = new CommonsHttpSolrServer("http://localhost:8080/solr");
// http://localhost:8080/solr/select/?q=outside
ModifiableSolrParams params = new ModifiableSolrParams();
params.set("qt", "/select");
params.set("q", "outside");
QueryResponse response = solr.query(params);
System.out.println("response = " + response);
}
}
However, I cant get past this error no matter what I do:
Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
Next, I tried the cookbook example:
import java.util.Iterator;
import org.apache.solr.client.solrj.SolrQuery; //Error: The import org.apache.solr.client.solrj.SolrQuery conflicts with a type defined in the same file
import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
import org.apache.solr.client.solrj.impl.XMLResponseParser;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrDocumentList;
public class SolrQuery {
public static void main(String[] args) throws Exception {
CommonsHttpSolrServer server = new CommonsHttpSolrServer("http://localhost:8080/solr");
server.setParser(new XMLResponseParser());
SolrQuery query = new SolrQuery();
query.setQuery("document"); //Error: The method setQuery(String) is undefined for the type SolrQuery
query.setStart(0); //Error: The method setStart(int) is undefined for the type SolrQuery
query.setRows(10); //Error: The method setRows(int) is undefined for the type SolrQuery
QueryResponse response = server.query(query); //Error: The method query(SolrParams) in the type SolrServer is not applicable for the arguments (SolrQuery)
SolrDocumentList documents = response.getResults();
Iterator<SolrDocument> itr = documents.iterator();
System.out.println("DOCUMENTS");
while(itr.hasNext()){
SolrDocument doc = itr.next();
System.out.println(doc.getFieldValue("id")+":"+doc.getFieldValue("content"));
}
}
}
However, that example might be dated for the current api as I cant even import the SolrQuery library.
Does anyone have a quick boilerplate example that works?
Thank you in advance.
PS. I am running windows7 with tomcat7 and solr 3.5. All I am trying to do at this point is a basic query and get the results back in some kind of list, array, whatever. When I query: http://localhost:8080/solr/select/?q=outside
in firefox, the results come back just fine.
i have List> i want it to copy all people in the previous collection to List collection.
i did it like:
var people = new List<Person>();
People.ForEach(q => people.AddRange(q.People));
return people;
is there any better way to do this?
With Jquery validator I'm able to use the following if statement to be sure my form is valid before proceeding with Ajax:
var frm = $(this).closest('form');
if($(frm).valid()){
AJAX JQUERY POST INFORMATION GOES HERE
};
Now I am using Javascript Form Validator from Javascript-Coder.com. The problem is none of the documentation describes a similar function to valid() or a way to check to see if the form is valid before proceeding. I am limited in javascript and could really use help from the community to build a similar if statement.
I am running the validation just fine but even when the validation fails my ajax script continues to run through to completion. In non ajax applications the validation works great and stops automatically before posting to php. But with ajax I can't seem to stop the script when validation fails to allow my user to correct their action.
I tried gleaning something from Here but it didn't get me close enough to do something useful. I tried some variations of what was offered there but I'm missing something.
My validation works great and is:
<script type="text/javascript">
var frmvalidator = new Validator("send_message_frm");
frmvalidator.EnableOnPageErrorDisplay();
frmvalidator.EnableMsgsTogether();
frmvalidator.addValidation("desc","alnum","Only numbers and letters are allowed");
frmvalidator.addValidation("desc","req","Please enter a description");
</script>
My ajax script works as well but I need it to not run if validation fails. It is:
$(document).ready(function(){
//Validate form....what can I put here to test if validation is completed properly????
//onclick handler send message btn
$("#send-message").click(function(){
$(this).closest('form').submit(function(){
return false;
});
var frm = $(this).closest('form');
$("#ajax-loading").show();
var data = $(frm).serialize();
$(frm).find('textarea,select,input').attr('disabled', 'disabled');
$.post(
"company_add.php",
data,
function(data){
$("#ajax-loading").hide();
$(frm).find('textarea,select,input').removeAttr('disabled');
$("#send_message_frm").prepend(data);
}
);
}
);
});
</script>
I have created a ArrayList<Student>
in a object StudentList list1
that is saving[Serialization]
a student's information (name,id,age,gpa,etc
) into the list1
, so that the list1[0] = 1st student's info
, then the list1[1] = 2nd student's info
and so on.
Also a new ArrayList<Subject>
in a object SubjectList list2
for all subject of a student at index 0 example list2[0]=(java,math,etc)
[for first student] list2[1]=(c++,english,etc)
[for second student] saved in a file.
I want to add the subject next to the student info:
list1 index[0]=1st Student info, index[1]=1st Student's Subjects.
index[2]=1st Student info,index[3]=1st Student's Subjects.
I am stuck with this simple problem.Help please. My codes too much messy couldn't post, Sorry for that.
//viewcontroller.m
-(void)viewdidLoad
{
self.theOneViewController= [[TheOneViewController alloc]init];
[contentsView addSubview:self.theOneViewController.view];
}
//theOneViewController
- (void)viewDidLoad
{ .
.
.
//UI WORK
.
.
//LONG WORK
[self performSelectorOnMainThread:@selector(initAppList) withObject:nil waitUntilDone:NO];
}
this code, view display UI WORK before LONG WORK is end.So I can have a thread effect.
//viewcontroller.m
-(void) buttonPressed:(id)sender -> event method
{
self.theOneViewController= [[TheOneViewController alloc]init];
[contentsView addSubview:self.theOneViewController.view];
}
//theOneViewController
- (void)viewDidLoad
{ .
.
.
//UI WORK
.
.
//LONG WORK
[self performSelectorOnMainThread:@selector(initAppList) withObject:nil waitUntilDone:NO];
}
In this code, view display UI WORK after LONG WORK is end.
So I can't have thread effect. why?
And I use (performSelectorInBackground:withObject:) instead of (performSelectorOnMainThread withObject:waitUntilDone:) . but this is slower than not using thread.
I want to have thread effect in event method call.
Is there a good way? help me please!
Shifting bits left and right is apparently faster than multiplication and division operations on most (all?) CPUs if you happen to be using a power of 2. However, it can reduce the clarity of code for some readers and some algorithms. Is bit-shifting really necessary for performance, or can I expect the compiler/VM to notice the case and optimize it (in particular, when the power-of-2 is a literal)? I am mainly interested in the Java and .NET behavior but welcome insights into other language implementations as well.
In my current project (which is really small) i have 3 tables/POCO entities which i would like to manipulate using EF.
The Tables are:
I now want to create a new Status in the database and user code like you see below
//Create new status (POCO) entity
var newStatus = new Status {
StatusId = status.Id,
UserId = user.Id,
Text = status.text,
CreateDate = DateTime.Now
};
// Persist need status to database
using (var db = new demoEntities())
{
db.Statuses.AddObject(newStatus);
db.SaveChanges();
}
This code works fine but i want to also set StatusType of the status entity. All possible status types are already included in the StatusType table. I don't want to create new statuses only create a reference.
I figured i should use something like :
status.StatusTypes == "new";
I have a ball in the screen .I want When I implemented action_down , the ball will move to this position .This my code :
public boolean onTouchEvent(MotionEvent event){
if(event.getAction()==MotionEvent.ACTION_DOWN){
x1 = (int) event.getX();
y1 = (int) event.getY();
float dx = x1-x;
float dy = y1-y;
float d = (float)Math.sqrt(dx*dx+dy*dy);
vx = dx*4/d;
vy = dy*4/d;
}
}
and onDraw:
protected void onDraw(Canvas canvas) {
canvas.drawColor(Color.BLACK);
Matrix matrix = new Matrix();
matrix2.postTranslate(x - bitmap.getWidth()/2, y - bitmap.getHeight()/2);
x = x+vx ;
y = y+vy ;
canvas.drawBitmap(bitmap, matrix, null);
}
When ,the ball will move to position action_down .But Why the ball was in the position action_down ,it don't stop ?
Please help me?
Thank you?
What I want to do is change every alert in the code to a custom alert("you used alert");
var hardCodedAlert = alert; //I know this won't work.But what to do ?
window.alert=function(){
if(this.count == undefined)
this.count=0;
this.count=this.count+1;
if(this.count == 1)
hardCodedAlert("You used alert");
};
I am trying to create Windows Phone app that comunicates with my PHP SOAP server that has no WSDL file. I am using this server in my Android app and It works like a charm. But I dont know how to create a SOAP client in C# for Windows Phone? Can anyone help? Thanks
As per the MSDN Documentation TaskFactory.StartNew it Creates and starts a Task. So, for the below code sample
class Program
{
public static void Main()
{
var t =Task.Factory.StartNew(
() => SomeLongRunningCalculation(10, Display)
);
var t1 = Task.Factory.StartNew(
() => SomeLongRunningCalculation(20, Display)
);
Console.WriteLine("Invoked tasks");
Task.WaitAll(t, t1);
Console.ReadLine();
}
public static void Display(int value)
{
Console.WriteLine(value);
}
public static void SomeLongRunningCalculation(int j, Action<int> callBack)
{
Console.WriteLine("Invoking calculation for {0}", j);
System.Threading.Thread.Sleep(1000);
if (callBack != null)
{
callBack(j + 1);
}
}
}
My expected output was
Invoking calculation for 10
Invoking calculation for 20
Invoked tasks
11
21
But, it is displaying
Invoked tasks
Invoking calculation for 20
Invoking calculation for 10
21
11
I would like to learn
I am iterating over a list and I want to print out the index of the item if it meets a certain condition. How would I do this?
Example:
testlist = [1,2,3,5,3,1,2,1,6]
for item in testlist:
if item == 1:
print position
There is one site called http://hattrick.cognizant.com which is made up of silverlight application. This site is opening in all other systems except mine.
I am getting an exception called:
Uncaught Error: Unhandled Error in Silverlight Application String was not recognized as a valid DateTime. at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at System.Convert.ToDateTime(String value, IFormatProvider provider)
at System.String.System.IConvertible.ToDateTime(IFormatProvider provider)
at System.Convert.ToDateTime(Object value)
at Hattrick.ViewModel.ScoreBoardViewModel.LoadMatchDetails(Object parameter)
at Hattrick.ViewModel.DelegateCommand.Execute(Object parameter)
at System.Windows.Interactivity.InvokeCommandAction.Invoke(Object parameter)
at System.Windows.Interactivity.TriggerBase.InvokeActions(Object parameter)
at System.Windows.Interactivity.EventTriggerBase.OnEvent(EventArgs eventArgs)
at System.Windows.Interactivity.EventTriggerBase.OnEventImpl(Object sender, EventArgs eventArgs)
at System.Windows.Controls.SelectionChangedEventHandler.Invoke(Object sender, SelectionChangedEventArgs e)
at System.Windows.Controls.Primitives.Selector.OnSelectionChanged(SelectionChangedEventArgs e)
at System.Windows.Controls.Primitives.Selector.InvokeSelectionChanged(List1 unselectedItems, List
1 selectedItems)
at System.Windows.Controls.Primitives.Selector.SelectionChanger.End()
at System.Windows.Controls.Primitives.Selector.SelectionChanger.SelectJustThisItem(Int32 oldIndex, Int32 newIndex)
at System.Windows.Controls.Primitives.Selector.OnSelectedValuePropertyChanged(Object value)
at System.Windows.Controls.Primitives.Selector.OnSelectedValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
at System.Windows.Data.BindingExpression.SendDataToTarget()
at System.Windows.Data.BindingExpression.SourcePropertyChanged(PropertyPathListener sender, PropertyPathChangedEventArgs args)
at System.Windows.PropertyPathListener.ReconnectPath()
at System.Windows.PropertyPathListener.RaisePropertyPathStepChanged(PropertyPathStep source)
at System.Windows.PropertyAccessPathStep.RaisePropertyPathStepChanged(PropertyListener source)
at System.Windows.CLRPropertyListener.SourcePropertyChanged(Object sender, PropertyChangedEventArgs args)
at System.Windows.Data.WeakPropertyChangedListener.PropertyChangedCallback(Object sender, PropertyChangedEventArgs args)
at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
at Hattrick.ViewModel.ScoreBoardViewModel.RaisedPropertyChanged(String property)
at Hattrick.ViewModel.ScoreBoardViewModel.hattrickClient_GetMatchDatesCompleted(Object sender, GetMatchDatesCompletedEventArgs e)
at Hattrick.HattrickService.HattrickServiceClient.OnGetMatchDatesCompleted(Object state)
Remind you that I didn't not made this site. Is there any problem with my system configuration.
My Configuration
OS : Windows 7
Silverlight: Version 5 latest 64bit
Browser : Chrome (Not working in any browser)
unsigned char *check = NULL;
check = (dynamic_cast<unsigned char *>( ns3::NetDevice::GetChannel() ));
This is what i am trying. but the error is:
"error: cannot dynamic_cast 'ns3::NetDevice::GetChannel() const()' (of type 'class ns3::Ptr') to type 'unsigned char*' (target is not pointer or reference to class)"
I also tried:
reinterpret_cast
Buti does'nt work at all. Stuck with it. Please HELP HELP HELP...
I coded a html5 (boilerplate) theme with masonry and infinite-scroll which so far has worked pretty well. Now I want to include reblog and like buttons on each post. I've tried to add this but for some reason the like button doesn't work.
URL to theme: http://inspiration.patrikarvidsson.com/
In the bottom of my script.js, I added this like-code.
$('a.like').click(function() {
var post = $(this).closest('.post');
var id = post.attr('id');
var oath = post.attr('rel').slice(-8);
var like = 'http://www.tumblr.com/like/'+oath+'?id='+id;
$('#likeit').attr('src', like);
$(this).toggleClass( 'liked' );
});
Complete scripts.js can be found here:
http://static.tumblr.com/e8lbmds/WB5m2q1it/scripts.js
And if needed, here's plugins.js: http://static.tumblr.com/e8lbmds/NDPm14qu6/plugins.js
The last line of the code above makes the link red; which I suppose indicates that the script responds. But no like is generated. Right after the initializing body tag, I have the following code:
<iframe id="likeit"></iframe>
Appertained css is the following:
#likeit { display: none; }
.liked, .like:hover { color: red !important; }
Any ideas why it's not working?
This is a modified version of tower of hanoi problem,it states
"A tower has n disks of various sizes ,you have to get them in sorted order.But theonly operation allowed is to pull out a set of disks,reverse the set of disks and put it back"
please does anyone know the solution?
To Test the max heap size and max permgen space, As per reply suggested by Gilli at Max amount of memory per java process in windows?, i wrote a simple java class with main method just printing system out
when i ran the class from Console with below param it ran fine but with 2048 it gave the error could not reserve Could not reserve enough space for object heap. It means for my system max heap size is allowed somewhere between 1536 to 2048
java -Xms1536m -Xmx1536m TestJVMParam
Fine till here. Now i want to find max permgen size for my system. So i ran the same program with below paramters
java -Xms1536m -Xmx1536m -XX:PermSize=128m -XX:MaxPermSize=128m TestJVMParam
but again it says Could not reserve enough space for object heap. How is that possible as i have
8GB RAM with windows7 64 bit os. And its not allowing even 128m for permgen? i am sure i am missing something here but not able to figure it out?
i need a code to type and perform commands in cygwin terminal in hidden mode(background) using visual basic, i was using cmd but now i want to use a Linux source code so i must use linux.
i ran cmd in hidden mode successfully but it isn't working with cygwin, here is the cmd code:
Shell("cmd.exe /k tracert -h " & _h & " " & domain.Text & " > temp" & i + 1 & ".txt & exit", AppWinStyle.Hide, True)
so i have tried
Shell(""C:\cygwin\Cygwin.bat -k tracert -h " & _h & " " & domain.Text & " > temp" & i + 1 & ".txt & exit", AppWinStyle.Hide, True)
and
Shell("C:\cygwin\Cygwin.bat")
'SendKeys.Send("tracert -h " & _h & " " & domain.Text & " > temp" & i + 1 & ".txt"))
but this still didn't work where in the second code i still have to press enter in cygwin to process the traceroute and which should be automaticcaly processed, so i hope that i'll find help in here.
I have got this piece of code:
public class ThreadInteraction {
public static void main(String[] argv) {
System.out.println("Create and start a thread t1, then going to sleep...");
Thread1 t1 = new Thread1();
t1.start();
try{
Thread.sleep(1000);
}
catch(InterruptedException e) {
System.out.println(e.toString());
}
//let's interrupt t1
System.out.println("----------- Interrupt t1");
t1.interrupt();
for(int i =0; i<100; i++)
System.out.println("Main is back");
}
}
class Thread1 extends Thread {
public void run() {
for(int i =0; i<10000; i++)
System.out.println(i + "thread1");
}
}
It seems like t1.interrupt() doesn't work as in my output all 10000 t1 print appears. Am I doing somethign wrong?
I'm interested in writing an app that send messages over IP (using 3g, not neccesarily on the same WiFi network as the receiving end) to a PIC microcontroller connected to a router (via ethernet or wifi)
I saw some descriptions and examples on how to send messages on the same network, not sure if just by giving a different IP it would work outside the network it self. I was wondering how can it be received by the PIC (still hasn't decided which PIC, depends on the possibility to perform this)
and in turn, depends on the msg received, the PIC will perform an action, for example, light a certain LED in a LED array.
I have the sending side (the app sending over IP), and receiveing side (the PIC which lights the LEDs)
I'm just not quite sure what to send, or if such "translation" is even possible.
I've searched the web but couldn't find any such thing except for made kit (for RC cars for example)
Thanks.
Carmel
I am trying to use git clone on Mac OS Snow Leopard. All I do is "git clone https://*/project.git" from documents/projects directory. For some reason operation never completes and stops at random points somewhere at the "Receiving Files:" stage(different % of copied files each time). Am I doing something wrong?
I need to send a JSON request similar to jQuery's ajax method.
The official documentation quote on the data parameter says:
If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting
So I have the same situation - a key that maps to an array "parameters":[123123, {"category":"123"}]
The complete data parameter looks like
$.ajax({
url: "/api/",
data: {"parameters":[123123, {"category":"123"}], "anotherParameter":"anotherValue"}
Would you mind telling how to achieve the same functionality in Java ?
How do I vertically center a header in the menu control?
This was my try:
<MenuItem Header="File" StaysOpenOnClick="True" FontFamily="Arial" VerticalAlignment="Center">
<MenuItem Header="Open" Click="Open_Click" IsEnabled="True"/>
</MenuItem>
</Menu>
But its aligned to the Top-left.
What am I doing wrong?
[EDIT]
My whole menu now looks like this:
<Menu Canvas.Left="0" Canvas.Top="0" Name="menu1" Margin="0,0,0,384">
<MenuItem Header="File" StaysOpenOnClick="True" FontFamily="Arial" VerticalAlignment="Center">
<MenuItem Click="Open_Click" IsEnabled="True">
<MenuItem.Header>
<TextBlock Text="Open" VerticalAlignment="Center"/>
</MenuItem.Header>
</MenuItem>
</MenuItem>
</Menu>
The header text 'file' still isn't vertically centered (which is what i want to center).
What exactly is this code centering? Is it the text 'open'?
[/EDIT]